main.yml - ansible-roles - A collection of ansible roles I have created over the years.
(HTM) git clone git://jay.scot/ansible-roles
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
main.yml (840B)
---
1 ---
2 - name: Include OS-specific variables
3 ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
4
5 - name: Install required packages
6 ansible.builtin.package:
7 name: "{{ common_packages }}"
8 state: present
9
10 - name: Added git service account
11 ansible.builtin.user:
12 name: "{{ git.user }}"
13 comment: "Git Service Account"
14 home: "{{ git.base_path }}"
15 shell: /usr/bin/git-shell
16 group: "{{ git.group }}"
17
18 - name: Set initial authorized key
19 ansible.posix.authorized_key:
20 user: git
21 state: present
22 key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
23
24 - name: Create systemd service file
25 ansible.builtin.template:
26 src: templates/git-daemon.service.j2
27 dest: /lib/systemd/system/git-daemon.service
28 owner: root
29 group: root
30 mode: "0644"
31 notify: Restart git-daemon