Browse Source

support root_target_directory

master
Markus Katharina Brechtel 7 years ago
parent
commit
19e0a3aa66
4 changed files with 19 additions and 9 deletions
  1. +5
    -2
      tasks/fish.yml
  2. +1
    -5
      tasks/main.yml
  3. +9
    -0
      tasks/password.yml
  4. +4
    -2
      tasks/ssh.yml

+ 5
- 2
tasks/fish.yml View File

@@ -3,16 +3,17 @@
- name: fish package
package:
name: fish
when: not root_target_directory is defined

- name: fish config directory
file:
path: /root/.config/fish/conf.d/
path: "{{ root_target_directory | default('') }}/root/.config/fish/conf.d/"
state: directory

- name: fish config files
template:
src: "{{ item }}.fish.j2"
dest: /root/.config/fish/conf.d/{{ item }}.fish
dest: "{{ root_target_directory | default('') }}/root/.config/fish/conf.d/{{ item }}.fish"
with_items:
- root-shell-aliases

@@ -20,8 +21,10 @@
user:
name: root
shell: /usr/bin/fish
when: not root_target_directory is defined

- name: fetch fish history
fetch:
src: /root/.local/share/fish/fish_history
dest: host_files
when: not root_target_directory is defined

+ 1
- 5
tasks/main.yml View File

@@ -1,10 +1,6 @@
---

- name: password
user:
name: root
password: "{{ root_password }}"
when: root_password is defined
- include: password.yml

- include: ssh.yml



+ 9
- 0
tasks/password.yml View File

@@ -0,0 +1,9 @@
---

- name: password
user:
name: root
password: "{{ root_password }}"
when:
- root_password is defined
- not root_target_directory is defined

+ 4
- 2
tasks/ssh.yml View File

@@ -5,10 +5,12 @@
name: root
generate_ssh_key: yes
ssh_key_type: ed25519
when: root_ssh_key
when:
- root_ssh_key
- not root_target_directory is defined

- name: ssh authorized keys
template:
src: ssh_authorized_keys.j2
dest: /root/.ssh/authorized_keys
dest: "{{ root_target_directory | default('') }}/root/.ssh/authorized_keys"
when: root_ssh_authorized_keys is defined