Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
feat(ansible): move docker setup to tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusMtnez committed Jan 15, 2024
1 parent 6518b14 commit e64b83c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
17 changes: 2 additions & 15 deletions ansible/playbooks/k3s-bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,8 @@
backrefs: true
when: check_cgroups.found == 0

- name: Setup containerd
block:
- name: Check if containerd (docker) is installed
ansible.builtin.lineinfile:
path: /boot/dietpi/.installed
line: "aSOFTWARE_INSTALL_STATE[162]=2"
state: absent
check_mode: true
changed_when: false
register: prereq_docker

- name: Install containerd (docker) # noqa no-handler no-changed-when
ansible.builtin.command:
cmd: /boot/dietpi/dietpi-software install 162
when: not prereq_docker.found
- name: Setup docker
ansible.builtin.include_tasks: ./tasks/docker.yml

- name: Setup nfs
ansible.builtin.package:
Expand Down
16 changes: 16 additions & 0 deletions ansible/playbooks/tasks/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Docker
block:
- name: Docker | check if docker is installed
ansible.builtin.lineinfile:
path: /boot/dietpi/.installed
line: "aSOFTWARE_INSTALL_STATE[162]=2"
state: absent
check_mode: true
changed_when: false
register: check_docker

- name: Docker | install docker # noqa no-handler no-changed-when
ansible.builtin.command:
cmd: /boot/dietpi/dietpi-software install 162
when: not check_docker.found

0 comments on commit e64b83c

Please sign in to comment.