Home page | Documentation | Variables | Handlers | Roles | Video
Playbook contains Plays contains Tasks call modules, Handlers can be triggered by tasks
$ git clone https://github.com/ansible/ansible.git && cd ansible
$ make deb
# dpkg -i ../ansible_XXX.deb
Create an inventory file with hostname in it and then
$ ansible -i <inventory> all -m setup --tree /tmp/facts
This is a simple bash module
#!/bin/bash
echo {\"args\": \"$(cat $1)\" }
exit 0
note that the argument to this is script is the file where the argument are written; it's possible to execute with
$ ansible -i inventory all -m testshell -a 'miao=bau foo=bar'
questionemeridionale | success >> {
"args": "miao=bau foo=bar"
}
if you save the script into a file named library/testshell
.
In order to provision with it
config.vm.provision "ansible" do |ansible|
ansible.playbook = "provisioning/playbook.yml"
#ansible.verbose = 'vvvv'
ansible.extra_vars = {
ansible_ssh_user: 'root',
db_user: "astauser",
db_name: "astadb",
db_password: "asta"
}
end