Skip to content

Commit

Permalink
user-git-server: Ckean-up and refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Rodier committed May 26, 2024
1 parent 5edf45d commit 02569b6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion roles/user-git-server/tasks/base/facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ansible.builtin.set_fact:
cakey_passphrase: >-
{{ lookup(creds.store, creds.prefix
+ "/ssh/ca-passphrase" + creds.opts.create) }}
+ "/ssh/server-keys-passphrase" + creds.opts.create) }}
tags: facts

- name: Filter the list of users to install / check / etc
Expand Down
10 changes: 10 additions & 0 deletions roles/user-git-server/tasks/install/user-send-keys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
ssh_files: '{{ lookup("ansible.builtin.fileglob", user_src_dir + "/*") | split(",") }}'
tags: emails

- name: Create the attachments folder
register: emails
ansible.builtin.file:
path: '{{ tmp_folder }}/attachments'
state: directory
owner: postmaster
group: postmaster
mode: '0700'
tags: emails

- name: Copy all the files to send in the temporary folder
register: emails
ansible.builtin.copy:
Expand Down
18 changes: 9 additions & 9 deletions roles/user-git-server/tasks/install/user-sign-key.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@
ignore_timestamps: true
tags: users, keys

- name: Create user SSH configuration template for this key
delegate_to: localhost
become: false
ansible.builtin.template:
src: ssh-user.conf
dest: '{{ backup_directory }}/ssh/users/{{ user.uid }}/{{ key_file_name }}-ssh.conf'
mode: '0644'
tags: users, keys

- name: Re-encrypt the key
no_log: '{{ hide_secrets }}'
delegate_to: localhost
Expand All @@ -84,3 +75,12 @@
-f '{{ backup_directory }}/ssh/ca/ca.key'
changed_when: true
tags: ca, keys

- name: Create user SSH configuration template for this key
delegate_to: localhost
become: false
ansible.builtin.template:
src: ssh-user.conf
dest: '{{ backup_directory }}/ssh/users/{{ user.uid }}/{{ key_file_name }}-ssh.conf'
mode: '0644'
tags: users, keys

0 comments on commit 02569b6

Please sign in to comment.