Browse Source

add task to update CA in container

update_ca_key
Edoardo Putti 8 years ago
parent
commit
2a62a025eb
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      roles/lxc_guest/tasks/main.yaml

+ 6
- 0
roles/lxc_guest/tasks/main.yaml View File

@ -157,6 +157,12 @@
set_fact:
user_ca_key: "{{ lookup('file', 'test_ssh_ca.pub') }}"
- name: Update container user CA key
container_file_write:
name: "{{ vm_name }}"
path: "/etc/ssh/user_ca.pub"
text: "ssh-rsa {{ user_ca_key }}"
- name: update container user ca key
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- bash -c "grep -F 'ssh-rsa {{ user_ca_key }}' /etc/ssh/user_ca.pub || echo 'ssh-rsa {{ user_ca_key }}' > /etc/ssh/user_ca.pub"
register: update_user_ca_key


Loading…
Cancel
Save