Skip to content

Instantly share code, notes, and snippets.

@MicTech
Last active August 29, 2015 14:22

Revisions

  1. MicTech revised this gist Jun 10, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -29,4 +29,10 @@ EC2

    ```
    ansible -i ec2.py -u ec2-user <region> -m ping --private-key private.pem
    ```

    Restart machine

    ```
    ansible -i ec2.py -u ec2-user <region> -a "/sbin/reboot" -f 10 --sudo --private-key private.pem
    ```
  2. MicTech revised this gist Jun 10, 2015. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,32 @@
    Change location of hosts file
    - create your own ansible.cfg

    ```
    [defaults]
    inventory = /path/to/hosts
    ```

    Ping all hosts

    ```
    ansible all -m ping --private-key private.pem -u ec2-user
    ```

    EC2

    ```
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini
    ```

    - create boto config with AWS keys

    ```
    [Credentials]
    aws_access_key_id = <here>
    aws_secret_access_key = <here>
    ```

    ansible -i ec2.py -u ec2-user <region> -m ping --private-key private.pem
    ```
    ansible -i ec2.py -u ec2-user <region> -m ping --private-key private.pem
    ```
  3. MicTech revised this gist Jun 10, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -10,8 +10,8 @@ Ping all hosts

    EC2

    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini

    - create boto config with AWS keys

  4. MicTech revised this gist Jun 10, 2015. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,8 @@ EC2

    - create boto config with AWS keys

    [Credentials]
    aws_access_key_id = <here>
    aws_secret_access_key = <here>
    [Credentials]
    aws_access_key_id = <here>
    aws_secret_access_key = <here>

    ansible -i ec2.py -u ec2-user <region> -m ping --private-key private.pem
  5. MicTech revised this gist Jun 10, 2015. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,15 @@ Change location of hosts file

    Ping all hosts

    ansible all -m ping --private-key private.pem -u ec2-user
    ansible all -m ping --private-key private.pem -u ec2-user

    EC2

    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
    wget https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini

    - create boto config with AWS keys

    [Credentials]
    aws_access_key_id = <here>
    aws_secret_access_key = <here>
  6. MicTech revised this gist Jun 10, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,8 @@ Change location of hosts file
    - create your own ansible.cfg

    [defaults]
    inventory = /path/to/hosts
    inventory = /path/to/hosts

    Ping all hosts

    ansible all -m ping --private-key private.pem -u ec2-user
  7. MicTech revised this gist Jun 10, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Change location of hosts file
    - create your own ansible.cfg

    [defaults]
    [defaults]
    inventory = /path/to/hosts
  8. MicTech created this gist Jun 10, 2015.
    5 changes: 5 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    Change location of hosts file
    - create your own ansible.cfg

    [defaults]
    inventory = /path/to/hosts