mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #27170 from rallytime/gce-docs
Update Getting Started with GCE docs to use cloud.profiles or cloud.profiles.d examples
This commit is contained in:
commit
de2027426e
1 changed files with 35 additions and 36 deletions
|
@ -60,6 +60,7 @@ Google Compute Engine Setup
|
|||
*If you are using ``libcloud >= 0.17.0`` it is recommended that you use the ``JSON
|
||||
format`` file you downloaded above and skip to the "Configuration" section below, using
|
||||
the JSON file **_in place of 'NEW.pem'_** in the documentation.
|
||||
|
||||
If you are using an older version of libcloud or are unsure of the version you
|
||||
have, please follow the instructions below to generate and format a new P12 key.*
|
||||
|
||||
|
@ -78,35 +79,31 @@ Google Compute Engine Setup
|
|||
|
||||
|
||||
|
||||
Configuration
|
||||
=============
|
||||
Provider Configuration
|
||||
======================
|
||||
|
||||
Set up the cloud config at ``/etc/salt/cloud``:
|
||||
Set up the provider cloud config at ``/etc/salt/cloud.providers`` or
|
||||
``/etc/salt/cloud.providers.d/*.conf``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Note: This example is for /etc/salt/cloud
|
||||
gce-config:
|
||||
# Set up the Project name and Service Account authorization
|
||||
project: "your-project-id"
|
||||
service_account_email_address: "123-a5gt@developer.gserviceaccount.com"
|
||||
service_account_private_key: "/path/to/your/NEW.pem"
|
||||
|
||||
providers:
|
||||
gce-config:
|
||||
# Set up the Project name and Service Account authorization
|
||||
#
|
||||
project: "your-project-id"
|
||||
service_account_email_address: "123-a5gt@developer.gserviceaccount.com"
|
||||
service_account_private_key: "/path/to/your/NEW.pem"
|
||||
# Set up the location of the salt master
|
||||
minion:
|
||||
master: saltmaster.example.com
|
||||
|
||||
# Set up the location of the salt master
|
||||
#
|
||||
minion:
|
||||
master: saltmaster.example.com
|
||||
# Set up grains information, which will be common for all nodes
|
||||
# using this provider
|
||||
grains:
|
||||
node_type: broker
|
||||
release: 1.0.1
|
||||
|
||||
# Set up grains information, which will be common for all nodes
|
||||
# using this provider
|
||||
grains:
|
||||
node_type: broker
|
||||
release: 1.0.1
|
||||
|
||||
provider: gce
|
||||
provider: gce
|
||||
|
||||
.. note::
|
||||
|
||||
|
@ -114,13 +111,14 @@ Set up the cloud config at ``/etc/salt/cloud``:
|
|||
is labeled as "Project ID" on the Google Developers Console.
|
||||
|
||||
|
||||
Cloud Profiles
|
||||
==============
|
||||
Set up an initial profile at ``/etc/salt/cloud.profiles``:
|
||||
Profile Configuration
|
||||
=====================
|
||||
Set up an initial profile at ``/etc/salt/cloud.profiles`` or
|
||||
``/etc/salt/cloud.profiles.d/*.conf``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
all_settings:
|
||||
my-gce-profile:
|
||||
image: centos-6
|
||||
size: n1-standard-1
|
||||
location: europe-west1-b
|
||||
|
@ -137,18 +135,18 @@ The profile can be realized now with a salt command:
|
|||
|
||||
.. code-block:: bash
|
||||
|
||||
salt-cloud -p all_settings gce-instance
|
||||
salt-cloud -p my-gce-profile gce-instance
|
||||
|
||||
This will create an salt minion instance named ``gce-instance`` in GCE. If
|
||||
the command was executed on the salt-master, its Salt key will automatically
|
||||
be signed on the master.
|
||||
|
||||
Once the instance has been created with salt-minion installed, connectivity to
|
||||
Once the instance has been created with a salt-minion installed, connectivity to
|
||||
it can be verified with Salt:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt 'ami.example.com' test.ping
|
||||
salt gce-instance test.ping
|
||||
|
||||
|
||||
GCE Specific Settings
|
||||
|
@ -159,7 +157,7 @@ typically also include a hard-coded default.
|
|||
|
||||
.. code-block:: yaml
|
||||
|
||||
all_settings:
|
||||
my-gce-profile:
|
||||
|
||||
# Image is used to define what Operating System image should be used
|
||||
# to for the instance. Examples are Debian 7 (wheezy) and CentOS 6.
|
||||
|
@ -231,11 +229,12 @@ typically also include a hard-coded default.
|
|||
|
||||
GCE instances do not allow remote access to the root user by default.
|
||||
Instead, another user must be used to run the deploy script using sudo.
|
||||
Append something like this to ``/etc/salt/cloud.profiles``:
|
||||
Append something like this to ``/etc/salt/cloud.profiles`` or
|
||||
``/etc/salt/cloud.profiles.d/*.conf``:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
all_settings:
|
||||
my-gce-profile:
|
||||
...
|
||||
|
||||
# SSH to GCE instances as gceuser
|
||||
|
@ -251,7 +250,7 @@ the metadata setting too:
|
|||
|
||||
.. code-block:: yaml
|
||||
|
||||
all_settings:
|
||||
my-gce-profile:
|
||||
...
|
||||
|
||||
metadata: '{"one": "1", "2": "two",
|
||||
|
@ -424,7 +423,7 @@ Specify the network name to view information about the network.
|
|||
salt-cloud -f show_network gce name=mynet
|
||||
|
||||
Create address
|
||||
---------------
|
||||
--------------
|
||||
Create a new named static IP address in a region.
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -432,7 +431,7 @@ Create a new named static IP address in a region.
|
|||
salt-cloud -f create_address gce name=my-fixed-ip region=us-central1
|
||||
|
||||
Delete address
|
||||
---------------
|
||||
--------------
|
||||
Delete an existing named fixed IP address.
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -440,7 +439,7 @@ Delete an existing named fixed IP address.
|
|||
salt-cloud -f delete_address gce name=my-fixed-ip region=us-central1
|
||||
|
||||
Show address
|
||||
---------------
|
||||
------------
|
||||
View details on a named address.
|
||||
|
||||
.. code-block:: bash
|
||||
|
|
Loading…
Add table
Reference in a new issue