I start this playbook install-mediawiki.yml, the first role is executed without problems.
The second role has 4 tasks, executed fully the 2 first of them, but has suddently an issue: the name of the node is not resolved anymore. I do not know why.
I have installed ansible in a virtual python environment and defines the inventory so:
(ansible2.7.10) user-ansible@node-manager:~$ cat inventaire.ini
[apache]
http2
[db]
bdd2
/etc/hosts in each node contains this:
(ansible2.7.10) user-ansible@node-manager:~$ cat /etc/hosts
…
192.168.0.103 http2
192.168.0.104 bdd2
The SSH connexion works withe key, the public keys are in the nodes…
Here is a ping test:
(ansible2.7.10) user-ansible@node-manager:~$ ansible -i inventaire.ini all -m ping
bdd2 | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
http2 | SUCCESS => {
“changed”: false,
“ping”: “pong”
}
The playbook:
(ansible2.7.10) user-ansible@node-manager:~$ cat install-mediawiki.yml
sorry to hear the loop did not help.
Generally I believe it is better to reply to the group and not to the correspondent personally (probably not even intended)
I changed ‘with_items’ for ‘loop’, as proposed. It does not resolve the issue.
By the way ‘with_items’ works well in another task in another role.
About the indentation, it is because of the email formating… (sorry)
‘become, become_user, args, command, run_once, delegate_to and with_items’ are aligned with ‘name’ (not with - )
‘creates and chdir’ have two more spaces compared to ‘args’.
Hi,
thanks. I have searched a lot these past days for a solution.
I have installed ansible in another VM, Ubuntu 20.04, as sshpass with apt. I configured everything, so that the first part of network works. I have also this time configured /etc/ansible/hosts, therefor I didn’t use -i inventaire.ini any more in the cli (ad-oc). Before, I didn’t have this file, because I was in a virtual python environment.
The result is positive, it works well. I can now access to mediawiki through a web browser
I will make a try with your proposal, but a bit later. I am a beginner, follow a tutorial and want learn further…