Use the Ansible runtime venv for pw-token-gen.py

Rather than installing pip packages on to the host system,
we can just execute the script and it will use the ansible
runtime venv. This works for Ocata onwards. Any earlier
releases can either pre-install the right packages, or
implement the change to the script shebang in a fork.

Change-Id: I88eb4c1bc9fe3a38803c5f0f5d1725dbed74dac7
This commit is contained in:
Jesse Pretorius 2018-08-15 14:51:07 +01:00
parent 8b508a9d90
commit 6af52b6b05

View File

@ -110,17 +110,8 @@
when:
- pre_config_osa | default(true) | bool
- name: Get pip2 and pw gen deps
shell: |
python2 /opt/get-pip.py
$(which pip2 || which pip) install setuptools pycrypto pyyaml
args:
chdir: /opt/openstack-ansible
when:
- pre_config_osa | default(true) | bool
- name: Create passwords
command: python2 ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
command: ./scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml
args:
chdir: /opt/openstack-ansible
when: