1
0
mirror of https://github.com/openshift/openshift-ansible-contrib.git synced 2026-02-05 09:45:58 +01:00

Fallback inventory_dir to the env PWD var (#851)

In ansible 2.4 localhost's inventory_dir is undefined.
Fix this with the env's $PWD lookup used as a fallback.

Fix CI job by passing inventory path as an extra var.

Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
This commit is contained in:
Bogdan Dobrelya
2017-11-14 16:20:51 +00:00
committed by Tomas Sedovic
parent d69e993107
commit d6e7c6f057
3 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ export INVENTORY="$PWD/playbooks/provisioning/openstack/sample-inventory"
echo INSTALL OPENSHIFT
ansible-playbook --become --timeout 180 --user openshift -i "$INVENTORY" ../openshift-ansible/playbooks/byo/config.yml -e @extra-vars.yaml
ansible-playbook --become --timeout 180 --user openshift -i "$INVENTORY" ../openshift-ansible/playbooks/byo/config.yml -e openstack_inventory_path="$INVENTORY" -e @extra-vars.yaml
echo Waiting for the router to come up

View File

@@ -68,7 +68,7 @@ echo
echo INSTALL OPENSHIFT
ansible-galaxy install -r playbooks/provisioning/openstack/galaxy-requirements.yaml -p roles
ansible-playbook --timeout 180 --user openshift -i "$INVENTORY" playbooks/provisioning/openstack/provision.yaml -e @extra-vars.yaml
ansible-playbook --timeout 180 --user openshift -i "$INVENTORY" playbooks/provisioning/openstack/provision.yaml -e openstack_inventory_path="$INVENTORY" -e @extra-vars.yaml
echo
echo INVENTORY hosts file:

View File

@@ -14,7 +14,7 @@
- cinder_hosted_registry_size_gb is defined
- role: static_inventory
when: openstack_inventory|default('static') == 'static'
inventory_path: "{{ openstack_inventory_path|default(inventory_dir) }}"
inventory_path: "{{ openstack_inventory_path|default(lookup('env','PWD') + '/inventory') }}"
private_ssh_key: "{{ openstack_private_ssh_key|default('') }}"
ssh_config_path: "{{ openstack_ssh_config_path|default('/tmp/ssh.config.openshift.ansible' + '.' + stack_name) }}"
ssh_user: "{{ ansible_user }}"