I use a VM and Intershop 7.8 to run an ansible-playbook (using this tutorial ). After installing Ansible, copying the content of the repository and configuring it (as shown in the "quick installation guide"), I tried to run the ansible-playbook "setupci.yml" using the command ansible-playbook setupci.yml
. Testing this the first time the error provided hosts list is empty, only localhost available
occurred. Solving this by creating a "hosts.yml" file, in which I declared a hostname and using other commands to run the playbook, two new errors occurred.
I tried the following command in the ci-set-ansible-playbook
directory:
$ --limit @[…]/ci-setup-ansible-playbook/setupci
I also tried:
$ ansible-playbook setupci.yml –connection=local
But both caused the errors:
fatal: [127.0.0.1]: FAILED! => {“changed”: false, “connection”: “close”, “content”: “\n \n 404 – Not Found
fatal: [127.0.0.1]: FAILED! => {“failed”: true, “msg”: “the field ‘args’ has an invalid value, which appears to include a variable that is undefined.
I guess ansible can't load the host vars for your host because the hostname that u defined in hosts.yml doesn't match the file name in /etc/ansible/host_vars/ directory. Maybe you didn't rename the sample.yml file, it needs to match the hostname.
See http://docs.ansible.com/ansible/latest/intro_inventory.html
[Update]
I tried out this ansible playbook on a docker centos 7 image. I also have some problem with getting it running correctly. However, i do get a connection. Make sure u copy the content of the git repo to /etc/ansible
edit the hosts file
Check that ansible can connect to the host
copy the sample.yml in group_var to ciserver.yml (same name as in hosts) file and edit it.
Run the playbook
My scripts stops when it tried to start/stop the firewall. The service doesn't exist on centos so it fails. See if u can get this far.