Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.
ansible all -i gce.py -m setup
asks for a passphrase
{% for host in groups['all'] | difference([inventory_hostname]) | sort(reverse=False) %}
{% for i in range(0, hostvars[host].nodes_in_region) %}
{{ hostvars[host].ansible_host }}:{{ hostvars[host].internal_port + i | int }}
{% endfor %}
{% endfor %}
- name: Copy bash profile to consul2 server
synchronize:
mode: push
src: rsync:/home/nubi-admin/.bash_profile
dest: /home/nubi-admin/.bash_profile
delegate_to: "{{ consul3_ip }}"
Team,
Wrote a Playbook that will perform the following tasks on a host in VMWARE Vcenter. The playbook runs on localhost.
I looped the playbook using with_items. If i gave a list of 50 machines the play will shutdown all the 50 and goes to next task.
If it does like that, it just register the first machine output and failed at debug conditions
I want the play to run all the task on each host and get to the next host.
I'm looking for assistance for this issue:
@gowthamakanthan
Team, Trying to convert the “region” in to variable, but not working. Any suggestions?
db_password: "{{ lookup('aws_secret', '{{ aws_secret_name }}', region=‘us-west-1') | from_json | json_query('\"' + aws_secret_key + '\"') }}”
when try to pass the region as {{ region }} variable, it’s throwing the following error. Tried to assign the region as environment variable as well, but not working.
Provided region_name '{{ region }}' doesn't match a supported format.”}
have tried the escape characters as well *
become_user: jboss_svc
shell: " . ~/.profile ; ./jboss-cli.sh --connect --controller=localhost:9990 -u=jbossadmin -p=changeit@123 --command=deploy /tmp/sa-health.war --force"
args:
chdir: "/apps/web/srv/jboss1/eap_home/bin"