Skip to content

Commit

Permalink
Split user/logging tasks to separate task files (#22)
Browse files Browse the repository at this point in the history
* Split user/logging tasks to separate task files

* Remove root package install from makefile
  • Loading branch information
teddyphreak authored Dec 12, 2023
1 parent 0b8f073 commit 045a897
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test: lint

poetry:
@type poetry >/dev/null || pip3 install poetry
@poetry install
@poetry install --no-root

lint: poetry
poetry run yamllint .
Expand Down
10 changes: 10 additions & 0 deletions tasks/logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Configure logging
ansible.builtin.copy:
dest: "{{ docker_log_conf_file }}"
content: "{{ docker_log_conf | to_nice_json(indent=2) }}"
group: root
owner: root
mode: 0644
notify: restart docker service
when: docker_log_conf_manage
29 changes: 5 additions & 24 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,8 @@
- name: Include service tasks
ansible.builtin.include_tasks: service.yml

- name: Configure logging
ansible.builtin.copy:
dest: "{{ docker_log_conf_file }}"
content: "{{ docker_log_conf | to_nice_json(indent=2) }}"
group: root
owner: root
mode: 0644
notify: restart docker service
when: docker_log_conf_manage
tags: configure

- name: Manage docker groups
ansible.builtin.group:
name: "{{ docker_group }}"
when: docker_group_manage
tags: configure

- name: Manage docker users
ansible.builtin.user:
append: true
groups: "{{ docker_group }}"
name: "{{ docker_user }}"
when: docker_user_manage
tags: configure
- name: Include logging tasks
ansible.builtin.include_tasks: logging.yml

- name: Include user tasks
ansible.builtin.include_tasks: users.yml
12 changes: 12 additions & 0 deletions tasks/users.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Manage docker groups
ansible.builtin.group:
name: "{{ docker_group }}"
when: docker_group_manage

- name: Manage docker users
ansible.builtin.user:
append: true
groups: "{{ docker_group }}"
name: "{{ docker_user }}"
when: docker_user_manage

0 comments on commit 045a897

Please sign in to comment.