From f18b313eba1a5d01c2567a6a8a3a92ff9ae5f6d3 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sun, 9 Apr 2023 22:17:16 +0200 Subject: [PATCH] started testings --- tasks/configure.yml | 24 +++++++++++------------- tasks/prerequisites.yml | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index e278693..d0420b7 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,21 +1,19 @@ --- # task/configure file for install_docker -- name: "Create group {{ install_docker_group }}" - ansible.builtin.group: - name: "{{ install_docker_group }}" - state: present - -- name: "Create directory {{ install_docker_daemon_dir }}" - ansible.builtin.file: - path: "{{ install_docker_daemon_dir }}" - state: directory - owner: root - group: root - mode: '0755' - - name: "Add specified users to group {{ install_docker_group }}" ansible.builtin.user: name: "{{ item }}" groups: "{{ install_docker_group }}" append: true loop: "{{ install_docker_users }}" + +- name: "Enable docker service" + ansible.builtin.service: + name: docker + enabled: true + +- name: "Start docker service" + ansible.builtin.service: + name: docker + state: restarted + when: install_docker_start_service diff --git a/tasks/prerequisites.yml b/tasks/prerequisites.yml index 75c24af..d5c08a1 100644 --- a/tasks/prerequisites.yml +++ b/tasks/prerequisites.yml @@ -7,3 +7,17 @@ changed_when: false delegate_to: localhost run_once: true + +- name: "Create group {{ install_docker_group }}" + ansible.builtin.group: + name: "{{ install_docker_group }}" + state: present + +- name: "Create directory {{ install_docker_daemon_dir }}" + ansible.builtin.file: + path: "{{ install_docker_daemon_dir }}" + state: directory + owner: root + group: root + mode: '0755' +