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 - name: fish package
package: package:
name: fish name: fish
when: not root_target_directory is defined


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


- name: fish config files - name: fish config files
template: template:
src: "{{ item }}.fish.j2" 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: with_items:
- root-shell-aliases - root-shell-aliases


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


- name: fetch fish history - name: fetch fish history
fetch: fetch:
src: /root/.local/share/fish/fish_history src: /root/.local/share/fish/fish_history
dest: host_files 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 - 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 name: root
generate_ssh_key: yes generate_ssh_key: yes
ssh_key_type: ed25519 ssh_key_type: ed25519
when: root_ssh_key
when:
- root_ssh_key
- not root_target_directory is defined


- name: ssh authorized keys - name: ssh authorized keys
template: template:
src: ssh_authorized_keys.j2 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 when: root_ssh_authorized_keys is defined