Ashyis there a way to continue on with a playbook if just 1 host fails?
Ashyso say i'm trying to run a bunch of tasks against 10 hosts in a group and one of them dies but i want to keep going with the rest of the hosts to the end of the playbook, how would i do that?
JmainguyAshy: yes
Jmainguyadd ignore_errors: true to the task you dont care about failing
Jmainguywell, actually that just continues on the host that failed anyway
Jmainguyby deafult it works the way you are asking for
Jmainguywhere it continues on with all hosts that havent had a failure
Ashyah ok thanks, i'll play around some more
axin25
axinheh wrong window
lronPawhola!
lronPawanyone awake?
lronPawi was wondering if it would be possible to assign the sudo password prompted for using -K as a variable to use in a playbook?
lronPawmy google-fu is lacking in finding a definitive answer
lronPawso come to the sauce of truth
lronPawirc! :P
h-rocklronPaw: did you see this - http://docs.ansible.com/ansible/become.html#connection-variables
lronPawh-rock: ooh.. no i did not.. thanks for the suggestion, i'll try now
h-rockalso, check out vars_prompt
h-rockor just vars
h-rockif you don't want to type the password every time
h-rockbut with vars_prompt i think you can set a default value if one isn't passed
h-rockalso, for passwords, i suggest using vault
h-rockhttp://docs.ansible.com/ansible/playbooks_vault.html
lronPawyeh im trying to avoid repeating my sudo passwd (which is long and easy to fat finger)
h-rockthis may help as well - http://docs.ansible.com/ansible/intro_configuration.html
lronPawyeh we auth against ad so that sudo passwd is used for other stuff like connecin to vcenter, etc
h-rockgotcha
lronPawi just set my vcenter_passwd to {{ bceome user_pass }} in the :vars block
lronPawhmm ansible_become_pass' is undefined
lronPawansible 2.3.0
lronPawsorry should of mentioned that before
lronPaw vars:
lronPaw - always_reboot: "{{ doreboot | default(False) }}"
lronPaw - target_hosts: "{{ hostgroup | default(all) }}"
lronPaw - serial_num: "{{ concurrency | default(10) }}"
lronPaw - run_mode: "{{ runmode | default('linear') }}"
lronPaw - admin_username: "{{ lookup('env','USER') }}"
lronPaw - vcenter_passwd: "{{ ansible_become_pass }}"
lronPaw*squint*
lronPawno typos
lr0nPawoops
lr0nPawok
lr0nPawno more pasting
lr0nPawdiscovered ansible_sudo_pass also was undefined
newdimensionI want to create a file for variables and encrypt using ansible vault. Where do I put it so all roles have access it it?
geerling_For ansible-container projects... is there any simple way to have multiple environment configuration differences captured in one or multiple container.yml files?
geerling_I know you can add dev_overrides... but what if I want to override a couple things for dev vs. stage vs. something else vs. prod?
gabbottnewdimension put ask_vault_pass = True in your ansible.cfg.
gabbottor use --ask-vault-pass when you call the play.
geerling_I guess one simple way would be to use --var-file to specify a different set of vars per environment
newdimensiongabbott: I'm still before that step. I'm not sure where to put the vault file so it's accessible to all roles
gabbottnewdimension vars_files in your play.
gabbott vars_files:
gabbott - vault.yml
newdimensionhmm looks like I was trying to use group_vars for no reason
newdimension(I don't have separate groups)
flowerysongnewdimension: group_vars/all is a perfectly good place to put global vars.
newdimensionI just learned that all can be a folder. So I did the following all/vars.yml all/vault.yml
newdimensionI want to share handlers among all my roles. I read that I can create a role called handlers and include it as a dependency for the other roles. Any other way to do this?
newdimensionI'm thinking I can just make handlers.yml and include that in my playbook
geerling_To follow up on my earlier inquiry... https://github.com/ansible/ansible-container/pull/609 contains the fix, and running ansible-container devel seems to allow var_file vars to pass through to playbooks.
d0hboyEvening , all.