Last active
December 12, 2015 08:19
-
-
Save yeukhon/4743318 to your computer and use it in GitHub Desktop.
Install with_items: {list} with extra-vars from cml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - hosts: $hosts | |
| user: $user | |
| sudo: True | |
| tasks: | |
| - name: install | |
| action: apt pkg=$item force=yes install_recommends=yes | |
| with_items: ${my_list} | |
| --------------- | |
| glasslab@flash:~/workstation/vagrant-workstation/tests4/graphyte_playbooks/playbooks$ ansible-playbook 1.yml -i ../hosts -u vagrant -k --extra-vars="user=vagrant hosts=live-webserver my_list=tree,curl" | |
| SSH password: | |
| PLAY [live-webserver] ********************* | |
| GATHERING FACTS ********************* | |
| ok: [192.168.1.229] | |
| TASK: [install] ********************* | |
| changed: [192.168.1.229] => (item=tree,curl) | |
| PLAY RECAP ********************* | |
| 192.168.1.229 : ok=2 changed=1 unreachable=0 failed=0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment