[TripleO][Ansible] generating ansible.cfg for manual config-download
Federico Iezzi
fiezzi at redhat.com
Thu Apr 9 18:42:00 UTC 2020
Hey there,
I've recently played with Config-Download in TripleO. My aim was since
the begging running Ansible standalone w/o relying on Mistral. TripleO
Ansible [1] can introduce drastic flexibility, IMO much needed to
improve the overall experience.
Now, the major road blocker I found, was in relation of Ceph-Ansible.
Without the nice ansible.cfg from Mistral, it's pretty much a bit hard
running Ansible standalone. Yes, manually exporting the various
Ansible paths can do the trick, but down the road, more and more roles
may be introduced forcing users to always discover the latest ones.
For example, in my case without the original ansible.cfg, the issue
was the following braking ceph-ansible.
$ ansible-playbook -i inventory.yaml --private-key ~/.ssh/id_rsa
--become deploy_steps_playbook.yaml
The error appears to be in
'/home/stack/config-download/external_deploy_steps_tasks.yaml': line
13, column 13, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- import_role:
role: ceph
^ here
To solve it, I wrote this simple [2] Python script that relies on
write_default_ansible_cfg from ansible in tripleo_common. The result
is that, after the heat provisioning [3] I generate the
config-download folder (with all its contents), the inventory and also
the ansible.cfg file and ansible standalone can be executed called.
You can find my templates and work at [4]
What do you think about including the ansible.cfg as part of the
config-download generation procedure?
Cheers,
Federico
[1] https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/ansible_config_download.html#playbooks
[2] https://github.com/m4r1k/nfvi_lab/blob/osp16/deployment_wrappers/write_default_ansible_cfg.py
[3] https://github.com/m4r1k/nfvi_lab/blob/osp16/deployment_wrappers/005-deploy.sh#L18-L68
[4] https://github.com/m4r1k/nfvi_lab/tree/osp16
More information about the openstack-discuss
mailing list