xcad 2 bulan lalu
induk
melakukan
f11a5dc548

+ 3 - 11
library/ansible/docker-install-ubuntu/playbook.yaml.j2 → library/ansible/docker-install-ubuntu/main.yml.j2

@@ -1,16 +1,8 @@
 ---
 ---
-- name: {{ playbook_name }}
+- name: Install Docker on Ubuntu
   hosts: {{ target_hosts }}
   hosts: {{ target_hosts }}
-{% if become %}
   become: true
   become: true
-{% endif %}
-{% if options_enabled and not gather_facts %}
-  gather_facts: false
-{% endif %}
-{% if secrets_enabled %}
-  vars_files:
-    - {{ secrets_file }}
-{% endif %}
+  gather_facts: true
 
 
   tasks:
   tasks:
     - name: Install docker dependencies
     - name: Install docker dependencies
@@ -32,7 +24,7 @@
     - name: Add docker repository
     - name: Add docker repository
       ansible.builtin.apt_repository:
       ansible.builtin.apt_repository:
         filename: docker
         filename: docker
-        repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {{ '{{' }} ansible_lsb.codename | lower {{ '}}' }} stable
+        repo: deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu {% verbatim %}{{ ansible_lsb.codename | lower }}{% endverbatim %} stable
         state: present
         state: present
 
 
     - name: Install docker engine
     - name: Install docker engine

+ 4 - 4
library/ansible/docker-install-ubuntu/template.yaml

@@ -21,7 +21,7 @@ metadata:
 spec:
 spec:
   general:
   general:
     vars:
     vars:
-      playbook_name:
-        default: Install docker
-      become:
-        default: true
+      target_hosts:
+        type: string
+        default: all
+        description: Target hosts for the Ansible playbook.