[TripleO][Ansible] generating ansible.cfg for manual config-download
fiezzi at redhat.com
Fri Apr 17 10:21:43 UTC 2020
Apologies for late answer.
First off, I didn't know about 'openstack tripleo config generate
ansible', that's pretty cool actually!
There are a couple of things to consider with that ansible.cfg:
When running the cmd, it's really not possible to specify an arbitrary
user (in this case using the standard heat-admin)
(undercloud) [stack at undercloud ~]$ openstack tripleo config generate
ansible --deployment-user heat-admin --output-dir ~/config-donwload
The --deployment-user value heat-admin does not match the user name
executing this command!
Then, it's hard-coded the fact_caching_connection always pointing to
/var/lib/mistral/ansible_fact_cache which is not accessible by stack
Also, back on my initial proposal, what do you think of always
generating an ansible.cfg within the config-download so that users can
more easily run ansible?
This would remove any deps from Mistral making the entire process easier.
EMEA Principal Telco Architect
On Thu, 9 Apr 2020 at 21:55, Alex Schultz <aschultz at redhat.com> wrote:
> Does 'openstack tripleo config generate ansible' not do it for you?
> On Thu, Apr 9, 2020 at 12:47 PM Federico Iezzi <fiezzi at redhat.com> wrote:
> > 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  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  Python script that relies on
> > write_default_ansible_cfg from ansible in tripleo_common. The result
> > is that, after the heat provisioning  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 
> > What do you think about including the ansible.cfg as part of the
> > config-download generation procedure?
> > Cheers,
> > Federico
> >  https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/ansible_config_download.html#playbooks
> >  https://github.com/m4r1k/nfvi_lab/blob/osp16/deployment_wrappers/write_default_ansible_cfg.py
> >  https://github.com/m4r1k/nfvi_lab/blob/osp16/deployment_wrappers/005-deploy.sh#L18-L68
> >  https://github.com/m4r1k/nfvi_lab/tree/osp16
More information about the openstack-discuss