Kaynağa Gözat

support root_target_directory

master
Markus Katharina Brechtel 6 yıl önce
ebeveyn
işleme
19e0a3aa66
4 değiştirilmiş dosya ile 19 ekleme ve 9 silme
  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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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 Dosyayı Görüntüle

@@ -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