diff --git a/enroll/virtual_enroll.yaml b/enroll/virtual_enroll.yaml index a2924b14d..14279c4af 100644 --- a/enroll/virtual_enroll.yaml +++ b/enroll/virtual_enroll.yaml @@ -31,10 +31,10 @@ driver_info: power: ssh_virt_type: "virsh" - ssh_address: "{{ ssh_address }}" - ssh_port: "{{ ssh_port }}" - ssh_username: "{{ ssh_username }}" - ssh_key_filename: "{{ ssh_private_key_path }}" + ssh_address: 127.0.0.1 + ssh_port: 22 + ssh_username: ironic + ssh_key_filename: /home/ironic/.ssh/id_rsa deploy: deploy_kernel: "{{ deploy_kernel_url }}" deploy_ramdisk: "{{ deploy_ramdisk_url }}" diff --git a/install/roles/install_standalone_ironic_localhost/tasks/main.yml b/install/roles/install_standalone_ironic_localhost/tasks/main.yml index 99299f664..cf03e04a4 100644 --- a/install/roles/install_standalone_ironic_localhost/tasks/main.yml +++ b/install/roles/install_standalone_ironic_localhost/tasks/main.yml @@ -135,6 +135,24 @@ - name: "Adding ironic user to libvirtd group" local_action: user name=ironic group=libvirtd append=yes when: testing == true +- name: "Creating SSH directory for ironic user" + local_action: file path=/home/ironic/.ssh owner=ironic group=ironic mode=0700 state=directory + when: testing == true +- name: "Checking for ironic user SSH key" + local_action: stat path=/home/ironic/.ssh/id_rsa + register: test_ironic_pvt_key +- name: "Generating SSH key for ironic user" + local_action: command ssh-keygen -f /home/ironic/.ssh/id_rsa -N "" + when: testing == true and test_ironic_pvt_key.stat.exists == false +- name: "Setting ownership on ironic SSH private key" + local_action: file name=/home/ironic/.ssh/id_rsa owner=ironic group=ironic mode=0600 state=file + when: testing == true and test_ironic_pvt_key.stat.exists == false +- name: "Setting ownership on ironic SSH public key" + local_action: file name=/home/ironic/.ssh/id_rsa.pub owner=ironic group=ironic mode=0644 state=file + when: testing == true and test_ironic_pvt_key.stat.exists == false +- name: "Creating authorized_keys file for ironic user" + local_action: command cp -p /home/ironic/.ssh/id_rsa.pub /home/ironic/.ssh/authorized_keys + when: testing == true - name: "Placing services" local_action: template src=init_template.j2 dest=/etc/init/{{item.service_name}}.conf owner=root group=root with_items: diff --git a/inventory/group_vars/all.yaml b/inventory/group_vars/all.yaml index e447bb591..22aea202a 100644 --- a/inventory/group_vars/all.yaml +++ b/inventory/group_vars/all.yaml @@ -27,9 +27,3 @@ dhcp_pool_end: 192.168.1.250 # ipmi_bridging: Default undefined. Valid values: "no", "single", and "dual" # See http://docs.openstack.org/developer/ironic/_modules/ironic/drivers/modules/ipmitool.html #ipmi_bridging: no - -# When testing with VMs, define SSH address, port, and user for agent_ssh driver. -ssh_username: ironic -ssh_port: 1024 -ssh_address: 127.0.0.1 -ssh_private_key_path: /home/ironic/.ssh/id_rsa