oVirt / ovirt-openshift-extensions

Implementation of flexvolume driver and provisioner for oVirt
Apache License 2.0
31 stars 16 forks source link

install.sh fails due to ansible vault - OKD on Ovirt #128

Closed somabc closed 5 years ago

somabc commented 5 years ago

Following https://www.ovirt.org/blog/2019/01/ovirt-openshift-part-1.html

Steps To Reproduce On a fresh CentOS 7 install

yum install podman -y curl -O "https://raw.githubusercontent.com/oVirt/ovirt-openshift-extensions/master/automation/ci/{install.sh,vars.yaml}"

Edit the vars.yaml:

engine_url: https://ovirt-engine-fqdn/ovirt-engine/api openshift_ovirt_cluster: yours openshift_ovirt_data_store: yours public_hosted_zone: example.com

bash install.sh

[root@vm-ness01 ~]# cat install.sh 

INSTALL_OKD=${INSTALL_OKD:-1}
INSTALL_EXTENSIONS=${INSTALL_EXTENSIONS:-1}

if [ "$INSTALL_OKD" == "1" ]; then
  podman run \
    -it \
    --rm \
    -v $(pwd)/vars.yaml:/usr/share/ansible/openshift-ansible/vars.yaml:Z \
    -e OPTS="-e @vars.yaml" \
    -e ANSIBLE_SSH_ARGS="-o ControlMaster=no" \
    quay.io/rgolangh/ovirt-openshift-installer
fi

if [ "$INSTALL_EXTENSIONS" == "1" ]; then
  podman run \
    -it \
    --rm \
    -v $(pwd)/vars.yaml:/usr/share/ansible/openshift-ansible/vars.yaml:Z \
    -e OPTS="-e @vars.yaml" \
    -e PLAYBOOK_FILE="install_extensions.yaml" \
    -e ANSIBLE_SSH_ARGS="-o ControlMaster=no" \
    quay.io/rgolangh/ovirt-openshift-installer
fi

See error

Output

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 131, column 3, found a duplicate dict key (runcmd). Using last defined value only.

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 131, column 3, found a duplicate dict key (mounts). Using last defined value only.

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 75, column 5, found a duplicate dict key (memory). Using last defined value only.

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 75, column 5, found a duplicate dict key (cores). Using last defined value only.

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 75, column 5, found a duplicate dict key (disks). Using last defined value only.

[WARNING]: While constructing a mapping from /usr/share/ansible/openshift- ansible/vars.yaml, line 75, column 5, found a duplicate dict key (cloud_init). Using last defined value only.

PLAY [Openshift Origin On oVirt]

TASK [ovirt_auth] Thursday 28 March 2019 18:59:42 +0000 (0:00:00.055) 0:00:00.055 ok: [localhost]

TASK [openshift_ovirt : include_tasks] Thursday 28 March 2019 18:59:42 +0000 (0:00:00.394) 0:00:00.449 included: /usr/share/ansible/openshift-ansible/roles/openshift_ovirt/tasks/build_vm_list.yml for localhost

TASK [openshift_ovirt : fail] Thursday 28 March 2019 18:59:42 +0000 (0:00:00.021) 0:00:00.470 skipping: [localhost]

TASK [openshift_ovirt : Create virtual machine list fact] Thursday 28 March 2019 18:59:42 +0000 (0:00:00.016) 0:00:00.487 fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'vault_root_password' is undefined\n\nThe error appears to have been in '/usr/share/ansible/openshift-ansible/roles/openshift_ovirt/tasks/build_vm_list.yml': line 9, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Create virtual machine list fact\n ^ here\n"}

PLAY RECAP *********************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1   

Thursday 28 March 2019  18:59:42 +0000 (0:00:00.034)       0:00:00.521 ******** 
=============================================================================== 
ovirt_auth -------------------------------------------------------------- 0.39s
openshift_ovirt : Create virtual machine list fact ---------------------- 0.03s
openshift_ovirt : include_tasks ----------------------------------------- 0.02s
openshift_ovirt : fail -------------------------------------------------- 0.02s

Expected behavior OKD created in Ovirt

Versions:

rgolangh commented 5 years ago

I extracted this sensitive info to a variable without updating the blog post. Sorry for that. Just edit the vars.yaml and look for vault_root_password and put the root password you want. I'll update the blog post accrodingly

somabc commented 5 years ago

Excellent it works great now, thanks!