diff --git a/ansible/maintenance/containerd.yml b/ansible/maintenance/containerd.yml new file mode 100755 index 000000000..d1bf8b26f --- /dev/null +++ b/ansible/maintenance/containerd.yml @@ -0,0 +1,28 @@ +#!/usr/bin/env ansible-playbook +--- +- name: Sync containerd and dockerd + hosts: all + order: sorted + gather_facts: true + user: root +# serial: 1 + tasks: + - name: Ensure certs.d/_default/ exists + file: + path: "{{item}}" + recurse: yes + state: directory + when: DOCKER_REGISTRY is defined + with_items: + - "/etc/containerd/certs.d/_default/" + - "/etc/dockerd/certs.d/_default/" + + - name: Setup Default mirror for all registries + copy: + content: | + server = "https://{{DOCKER_REGISTRY[0]}}" + dest: "{{item}}" + when: DOCKER_REGISTRY is defined + with_items: + - "/etc/containerd/certs.d/_default/hosts.toml" + - "/etc/dockerd/certs.d/_default/hosts.toml" diff --git a/ansible/maintenance/etchosts.yml b/ansible/maintenance/etchosts.yml new file mode 100755 index 000000000..460be0f39 --- /dev/null +++ b/ansible/maintenance/etchosts.yml @@ -0,0 +1,15 @@ +#!/usr/bin/env ansible-playbook +--- +- name: Sync /etc/hosts file with local host and group vars + hosts: all + order: sorted + gather_facts: true + user: root +# serial: 1 + tasks: + - name: Configure hosts + copy: + content: | + {{etchosts}} + dest: /etc/hosts + when: etchosts is defined