diff --git a/tests/run.yml b/tests/run.yml index 9233774034..c4cad60fa0 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -283,30 +283,9 @@ - name: generate passwords command: "{{ kolla_ansible_venv_path }}/bin/kolla-genpwd" - - name: slurp kolla passwords - slurp: - src: /etc/kolla/passwords.yml - register: passwords_yml - - - name: write out kolla SSH private key - copy: - content: "{{ (passwords_yml.content | b64decode | from_yaml).kolla_ssh_key.private_key }}" - dest: ~/.ssh/id_rsa_kolla - mode: 0600 - - - name: authorise kolla public key for zuul user - authorized_key: - user: "{{ ansible_env.USER }}" - key: "{{ (passwords_yml.content | b64decode | from_yaml).kolla_ssh_key.public_key }}" - # Delegate to each host in turn. If more tasks require execution on all - # hosts in future, break out into a separate play. - with_inventory_hostnames: - - all - delegate_to: "{{ item }}" - - name: Record the running state of the environment as seen by the setup module shell: - cmd: "{{ kolla_ansible_venv_path }}/bin/ansible all -i {{ kolla_inventory_path }} -e ansible_user={{ ansible_user }} -m setup > /tmp/logs/ansible/initial-setup" + cmd: "{{ kolla_ansible_venv_path }}/bin/ansible all -i {{ kolla_inventory_path }} -m setup > /tmp/logs/ansible/initial-setup" - name: Set facts for actions set_fact: diff --git a/tests/setup_gate.sh b/tests/setup_gate.sh index 75cf3934d7..5886c61d03 100755 --- a/tests/setup_gate.sh +++ b/tests/setup_gate.sh @@ -143,7 +143,7 @@ setup_openstack_clients RAW_INVENTORY=/etc/kolla/inventory source $KOLLA_ANSIBLE_VENV_PATH/bin/activate -kolla-ansible -i ${RAW_INVENTORY} -e ansible_user=$USER -vvv bootstrap-servers &> /tmp/logs/ansible/bootstrap-servers +kolla-ansible -i ${RAW_INVENTORY} -vvv bootstrap-servers &> /tmp/logs/ansible/bootstrap-servers deactivate prepare_images diff --git a/tests/templates/ceph-inventory.j2 b/tests/templates/ceph-inventory.j2 index b9f87dcb43..f005bfec5f 100644 --- a/tests/templates/ceph-inventory.j2 +++ b/tests/templates/ceph-inventory.j2 @@ -1,6 +1,6 @@ [storage] {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} # Ceph-Ansible hosts diff --git a/tests/templates/inventory.j2 b/tests/templates/inventory.j2 index 28cf537785..bd8b50ca8f 100644 --- a/tests/templates/inventory.j2 +++ b/tests/templates/inventory.j2 @@ -8,15 +8,15 @@ [control] {% if scenario == 'masakari' %} {% for host in hostvars if host in ['primary'] %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% elif scenario == 'monasca' %} {% for host in hostvars if host in ['primary', 'secondary1', 'secondary2'] %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% else %} {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% endif %} @@ -32,40 +32,40 @@ control [compute] {% if scenario == 'masakari' %} {% for host in hostvars if host in ['ternary1', 'ternary2'] %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% else %} {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% endif %} [storage] {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} [monitoring] {% if scenario == 'monasca' %} {% for host in hostvars if host in ['secondary3', 'secondary4', 'secondary5'] %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% else %} {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% endif %} [deployment] {% for host in hostvars %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endfor %} {% if scenario == 'cells' %} {% for host in hostvars %} {% set cell_name = 'cell' ~ loop.index %} [{{ cell_name }}] -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} mariadb_shard_id={{ loop.index0 % 2 }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} mariadb_shard_id={{ loop.index0 % 2 }} [{{ cell_name }}:vars] nova_cell_name = {{ cell_name }} @@ -139,7 +139,7 @@ control [hacluster] {% for host in hostvars %} {% if host in ['primary', 'secondary'] %} -{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} ansible_user=kolla ansible_ssh_private_key_file={{ ansible_env.HOME ~ '/.ssh/id_rsa_kolla' }} +{{ host }} ansible_host={{ hostvars[host]['ansible_host'] }} {% endif %} {% endfor %}