--- - hosts: openstack environment: http_proxy: "{{ lookup('env','http_proxy') }}" https_proxy: "{{ lookup('env','https_proxy') }}" no_proxy: "{{ lookup('env','no_proxy') }}" HTTP_PROXY: "{{ lookup('env','http_proxy') }}" HTTPS_PROXY: "{{ lookup('env','https_proxy') }}" NO_PROXY: "{{ lookup('env','no_proxy') }}" remote_user: root vars_files: - "{{ xci_path }}/xci/var/opnfv.yml" pre_tasks: - name: Load distribution variables include_vars: file: "{{ item }}" with_items: - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml" - "{{ xci_flavor_ansible_file_path }}/flavor-vars.yml" roles: - role: peru.proxy_settings proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}" proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}" proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}" proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}" - role: bootstrap-host - role: configure-nfs when: - "'compute' in group_names" - role: configure-ceph when: - xci_ceph_enabled == "true" - "'compute' in group_names" tasks: - name: Determine local user become: no local_action: command whoami changed_when: False register: _ansible_user - name: Fetch local SSH key delegate_to: localhost become: no slurp: src: "/home/{{ _ansible_user.stdout }}/.ssh/id_rsa.pub" register: _local_ssh_key - name: Fetch OPNFV SSH key delegate_to: opnfv slurp: src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" register: _opnfv_ssh_key - name: "Configure {{ inventory_hostname }} authorized_keys file" authorized_key: exclusive: "{{ item.exclusive }}" user: root state: present manage_dir: yes key: "{{ item.key }}" comment: "{{ item.comment }}" with_items: - { key: "{{ _local_ssh_key['content'] | b64decode }}", comment: "{{ _ansible_user.stdout }} key", exclusive: yes } - { key: "{{ _opnfv_ssh_key['content'] | b64decode }}", comment: "opnfv host key", exclusive: no }