amazon web services - Ansible AWS Dynamic Inventory Search by Tags -


i have two-fold question. writing first steps script test blue/green deployment. want able search aws inventory server specified set of tags, , add tag well. bring new servers. able go , find old servers , shut them down, , retag new servers brought up.

my first question how search , add tags existing aws inventory , new inventory brought dynamically.

secondly, want validate set have currently, , understand why playbook not run.

i have ansible set /etc/ansible/ having ec2.ini , ec2.py, i've renamed, hosts...

my file structure follows:

- release  - site.yml  - prep.yml  - roles   - prep    - tasks     - main.yml    - defaults    - vars  

the contents of site.yml is:

- include: prep.yml 

the contents of prep.yml follows:

name: find previous ec2 instances hosts: localhost connection: local roles:     - prep 

the contents of main.yml under release/roles/prep/tasks/ :

-   name: ec2 instance facts     local_action: ec2_facts     register: instance_data  - debug: msg ="found nodes {{instance_data.ansible_facts}}"     with_items: instance_data 

i getting error set follows:

error! syntax error while loading yaml.   error appears have been in '/users/.../playbooks/release/prep.yml': line 4, column 1, may elsewhere in file depending on exact syntax problem.  offending line appears be:  connection: local -   name: ec2 instance facts ^ here 


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -