Skip to content
Snippets Groups Projects
Commit 801d3380 authored by Kamil Andoniadis's avatar Kamil Andoniadis
Browse files

use SSH key generated by django-openstack

parent 3c51107d
Branches
Tags v2.2.0
No related merge requests found
...@@ -28,26 +28,20 @@ ...@@ -28,26 +28,20 @@
table: nat table: nat
jump: MASQUERADE jump: MASQUERADE
- include_vars: user-access.yml
- name: create SSH proxy user
user:
name: '{{ user_name }}'
generate_ssh_key: yes
- hosts: - hosts:
- smn - smn
- uan - uan
gather_facts: no gather_facts: no
become: yes become: yes
become_user: root become_user: root
vars:
user_name: user-access
tasks: tasks:
- include_vars: user-access.yml
- name: create SSH proxy user - name: create SSH proxy user
user: user:
name: '{{ user_name }}' name: '{{ user_name }}'
shell: /bin/bash
- name: ensure existence of SSH directory - name: ensure existence of SSH directory
file: file:
...@@ -60,11 +54,11 @@ ...@@ -60,11 +54,11 @@
- name: add public key to authorized keys - name: add public key to authorized keys
authorized_key: authorized_key:
user: '{{ user_name }}' user: '{{ user_name }}'
key: '{{ public_key_content }}' key: '{{ lookup("file", user_public_key_path) }}'
- name: copy private key of SSH proxy user - name: copy private key of SSH proxy user
copy: copy:
src: '{{ private_key }}' src: '{{ user_private_key_path }}'
dest: /home/{{ user_name }}/.ssh dest: /home/{{ user_name }}/.ssh
owner: '{{ user_name }}' owner: '{{ user_name }}'
group: '{{ user_name }}' group: '{{ user_name }}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment