From b41930f5432d2aa39b20804cada1f59fabcb4fa3 Mon Sep 17 00:00:00 2001 From: kekskurse Date: Wed, 13 Oct 2021 13:22:25 +0200 Subject: [PATCH] Stuff --- tasks/composer.yml | 12 ++++++++++++ tasks/docker.yml | 14 ++------------ tasks/main.yml | 8 +++++++- tasks/traefic.yml | 21 +++++++++++++++++++++ 4 files changed, 42 insertions(+), 13 deletions(-) create mode 100644 tasks/composer.yml create mode 100644 tasks/traefic.yml diff --git a/tasks/composer.yml b/tasks/composer.yml new file mode 100644 index 0000000..005306c --- /dev/null +++ b/tasks/composer.yml @@ -0,0 +1,12 @@ +- name: Install python3-setuptools + apt: + name: python3-setuptools + state: present +- name: Install docker python package + pip: + name: docker + executable: pip3 +- name: Install docker python package + pip: + name: docker-compose + executable: pip3 \ No newline at end of file diff --git a/tasks/docker.yml b/tasks/docker.yml index f371783..21c5172 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -42,18 +42,8 @@ owner: root group: root mode: '0644' -- name: Install python3-setuptools - apt: - name: python3-setuptools - state: present -- name: Install docker python package - pip: - name: docker - executable: pip3 -- name: Install docker python package - pip: - name: docker-compose - executable: pip3 + + - name: Run `docker-compose up` again community.docker.docker_compose: project_src: /root/traefic/ diff --git a/tasks/main.yml b/tasks/main.yml index 4a64a56..f8224b0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,8 @@ - name: Install Docker - include: docker.yml \ No newline at end of file + include: docker.yml + +- name: Install Docker + include: composer.yml + +- name: Install Traefic + include: traefic.yml \ No newline at end of file diff --git a/tasks/traefic.yml b/tasks/traefic.yml new file mode 100644 index 0000000..34d6a95 --- /dev/null +++ b/tasks/traefic.yml @@ -0,0 +1,21 @@ +- name: Recursively change ownership of a directory + ansible.builtin.file: + path: /root/traefic + state: directory + recurse: yes + owner: root + group: root + +- name: Template a file to /root/traefic/doicker-compose.yml + ansible.builtin.template: + src: docker-compose.j2 + dest: /root/traefic/docker-compose.yml + owner: root + group: root + mode: '0644' + + +- name: Run `docker-compose up` again + community.docker.docker_compose: + project_src: /root/traefic/ + build: no \ No newline at end of file