If you are using GitLab outside of the ILL, then you will need to use HTTPS and not SSH for clone/push/pull operations. SSH will work normally if you are using the VPN.

Commit da0bea09 authored by eric pellegrini's avatar eric pellegrini

delegate the ssh key generation to ansible controller

parent bd5a4c2d
......@@ -183,7 +183,7 @@ os_keypairs:
identity_file: "~/.ssh/openstack/extra-cluster"
os_vms_commons:
keypair: "{{ os_keypairs[0]['name'] }}"
keypair: "{{ os_keypairs[1]['name'] }}"
network: "{{ os_networks['networks'][0]['name'] }}"
availability_zone: nova
security_groups: "{{ os_networks['security_groups'] | map(attribute='name') | list }}"
......
---
- block:
- name: create if necessary the private/public key directory
file:
path: "{{ item.item.identity_file | dirname }}"
path: "{{ item.identity_file | dirname | expanduser }}"
state: directory
- name: create local private key
copy:
content: "{{ item.key.private_key }}"
dest: "{{ item.item.identity_file }}"
mode: "600"
force: True
- name: create ssh private/public key
openssh_keypair:
path: "{{ item.identity_file | expanduser }}"
size: "{{ item.size }}"
type: "{{ item.type }}"
force: False
- name: create local public key
copy:
content: "{{ item.key.public_key }}"
dest: "{{ item.item.identity_file }}.pub"
mode: "600"
force: True
- name: delete existing openstack ssh key pair
os_keypair:
name: "{{ item.name }}"
auth: "{{ item.auth }}"
auth_type: "{{ item.auth_type }}"
state: absent
- name: create openstack ssh key pair
os_keypair:
name: "{{ item.name }}"
auth: "{{ item.auth }}"
auth_type: "{{ item.auth_type }}"
state: "{{ item.state | default(omit) }}"
cloud: "{{ item.cloud | default(omit) }}"
public_key_file: "{{ item.identity_file | expanduser }}.pub"
region_name: "{{ item.region_name | default(omit) }}"
---
# tasks file for roles/os-keypairs
- name: create openstack ssh key pair
os_keypair:
name: "{{ item.name }}"
auth: "{{ item.auth }}"
auth_type: "{{ item.auth_type }}"
state: "{{ item.state | default(omit) }}"
cloud: "{{ item.cloud | default(omit) }}"
region_name: "{{ item.region_name | default(omit) }}"
loop: "{{ keypairs }}"
register: keys
- include_tasks: keys.yml
when: item.key.private_key is defined
loop: "{{ keys.results }}"
loop: "{{ keypairs }}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment