Ansible is still inoperative. Please advise on questions re deployment
Message from Josh re Drupal deployment:
Ansible is still inoperative. Andrew was not able to to get it working based on the instructions you gave Monday.
Andrew is on vacation, so can you please review the following and see if you can assist Nick get it working. He himself is on vacation starting Sunday, so your help today possible or latest tomorrow morning would be greatly appreciated.
Can you please answer the questions.
If you can answer the request on email it would be helpful. Nick will be going on vacation on Sunday, so there is urgency to get this done immediately.
Fron Nick Ivinsky:
I've been given two machines. 54.210.117.78 - that was supposed to have ansible installed. It had it a week ago but not now. 54.88.113.237 - supposedly clean ubuntu machine to install ansible
I followed procedure given here https://gitlab.paragon-es.de/ansible-playbooks/general to install ansible. Procedure was mostly OK with few problems that I had to solve myself or google to find solutions:
-
I had to execute most of the commands with sudo
-
had to install prerequisites such as git and python
-
When running "playbooks/setup_local.py" it threw an error: fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'ansible_pkg_mgr == 'apt'' failed. The error was: error while evaluating conditional (ansible_pkg_mgr == 'apt'): 'ansible_pkg_mgr' is undefined\n\n The error appears to have been in '/opt/ansible/playbooks/setup_local.yml': line 29, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n
- block:\n - block:\n ^ here\n"} Had to set "gather_facts: true" in playbooks/setup_local.py to resolve that error -
Guide included step "ansible-playbook.py hosts" to add hosts to hosts file but it didn't work. I've added crcdev1 and 2 manually but not sure if it's needed at all. reference machine had only one host added.
-
Guide suggests runing 3 sripts "setup_local.py, update.sh, config.sh" - it's not clear whether i need to run all three on initial setup or not.
-
Guide includes reference to boto instructions but they were not there. "If you want to use the dynamic AWS EC2 inventory, you should install boto (details see above)"
After installing ansible it got more confusing:
There are various configuration steps that include remote user configuration, .ssh/config, etc/ansible.cfg, etc. I had to look at existing machine to figure out what to write in these config files. It's important to understand which config files ansible is using when it's executed.
I believe I reached the point where I can execute inithost.py and apb. (I mean all required components installed and commands are available) BUT: -For apb I need to setup keys so ansible can connect to crcdev machines. -For inithost (adding new AWS machines) there are more settings. Here is a sample command: ***>inithost.py crcdev3 --ip=1.2.3.4 --root=ubuntu --key=/home/jurgenhaas/.ssh/Jurgen.pem --cloud=ec2 --groups=webserver,dbserver,webserver-drupal,dbserver-mysql,nodejsserver,s3client We don't really need to create new dev machines now and we can skip that. However It's not clear where to get new IPs and where to get a key to run this command.
Working ansible machine would be helpful as it would let me see proper output from running playbooks and compare it to output on my test machine.