aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2020-12-26 14:17:41 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2020-12-26 14:17:41 +0100
commit9e4e02fdfb5a9e038c5e09a38fa51b457164156b (patch)
tree7c3f088425b3998432e70e59fa802f613f49e374 /ansible/roles
parent4083f32156c5df71cb6ea370a411e152c8a67b8b (diff)
downloadinfra-9e4e02fdfb5a9e038c5e09a38fa51b457164156b.tar.gz
infra-9e4e02fdfb5a9e038c5e09a38fa51b457164156b.tar.bz2
infra-9e4e02fdfb5a9e038c5e09a38fa51b457164156b.tar.xz
infra-9e4e02fdfb5a9e038c5e09a38fa51b457164156b.zip
Replaced malabaricus.
Diffstat (limited to 'ansible/roles')
-rw-r--r--ansible/roles/docker-host/defaults/main.yml1
-rw-r--r--ansible/roles/docker-host/tasks/main.yml28
-rw-r--r--ansible/roles/unix-machine/tasks/main.yml9
3 files changed, 33 insertions, 5 deletions
diff --git a/ansible/roles/docker-host/defaults/main.yml b/ansible/roles/docker-host/defaults/main.yml
new file mode 100644
index 0000000..64fc11d
--- /dev/null
+++ b/ansible/roles/docker-host/defaults/main.yml
@@ -0,0 +1 @@
+docker_host__credentials: []
diff --git a/ansible/roles/docker-host/tasks/main.yml b/ansible/roles/docker-host/tasks/main.yml
new file mode 100644
index 0000000..715a917
--- /dev/null
+++ b/ansible/roles/docker-host/tasks/main.yml
@@ -0,0 +1,28 @@
+- become: yes
+ tags: never,packages
+ apt:
+ name:
+ - docker.io
+ - docker-compose
+ - gnupg2
+ - pass
+ install_recommends: no
+
+- name: Logging in to docker registries
+ loop: "{{ docker_host__credentials }}"
+ become: yes
+ command:
+ cmd: docker login -u "{{ item.username }}" --password-stdin "{{ item.registry }}"
+ stdin: "{{ item.password }}"
+ no_log: yes
+
+- name: Create /etc/docker/daemon.json
+ when: docker_host__daemon_json_content|default("")|length > 0
+ become: yes
+ register: docker_json
+ copy:
+ dest: /etc/docker/daemon.json
+ content: "{{ docker_host__daemon_json_content }}"
+
+- debug: msg="docker.json changed, you must manually restart docker."
+ when: docker_json.changed
diff --git a/ansible/roles/unix-machine/tasks/main.yml b/ansible/roles/unix-machine/tasks/main.yml
index 9e3464f..82d835d 100644
--- a/ansible/roles/unix-machine/tasks/main.yml
+++ b/ansible/roles/unix-machine/tasks/main.yml
@@ -1,5 +1,5 @@
- name: /etc/apt/apt.conf.d/99force-ipv4
- copy:
+ file:
dest: /etc/apt/apt.conf.d/99force-ipv4
state: absent
@@ -9,11 +9,10 @@
- name: packages (early)
tags: packages
apt:
- name: "{{ item }}"
+ name:
+ - git
+ - etckeeper
install_recommends: no
- with_items:
- - git
- - etckeeper
- name: packages
tags: packages