Skip to content

Commit

Permalink
🐛 fix docker-compose role
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsavio committed Jul 31, 2018
1 parent 8e4d101 commit 93c9d7f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ tag: clean
@echo "Creating git tag v$(tag)"
git tag v$(tag)
git push --tags

runvm:
vagrant up vepcon
2 changes: 1 addition & 1 deletion playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
roles:
- { role: common, become: yes, become_method: sudo, tags: common }
- { role: python, become: yes, become_method: sudo, tags: python }
- { role: docker-compose, become: yes, become_method: sudo, tags: docker_compose }
- { role: docker-compose, tags: docker_compose }
- { role: chatbot, tags: chatbot }
5 changes: 1 addition & 4 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
# Common tasks

# Prepare directories
- name: prepare | Create directories
file:
path: '{{ item }}'
Expand All @@ -27,7 +25,6 @@
with_items:
- language-pack-en
- build-essential
- libssl-dev
- python-dev
- python3
- python3-dev
- python3-pip
21 changes: 11 additions & 10 deletions roles/docker-compose/tasks/install_docker_compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
- libssl-dev
- python-dev
- python-pip
become: yes
become_method: sudo

- name: Install docker-compose
- name: Install pipsi
pip:
name: '{{ item }}'
state: forcereinstall
with_items:
- cryptography==2.3
- docker-compose==1.22.0
- pipsi
executable: pip3
become: yes
become_method: sudo

- name: docker-compose.yml template file
copy:
src: docker-compose.yml
dest: "{{ docker_compose_filepath }}"
owner: "{{ user }}"
group: "docker"
mode: 0640
- name: Install docker-compose
command:
pipsi install docker-compose==1.22.0
args:
creates: "{{ home_dir }}/.local/bin/docker-compose"
20 changes: 16 additions & 4 deletions roles/docker-compose/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---

- include_tasks: install_docker.yml
- import_tasks: install_docker.yml
become: yes
become_method: sudo
tags: [docker, docker_compose]

- include_tasks: install_docker_compose.yml
- import_tasks: install_docker_compose.yml
tags: [docker, docker_compose]

- include_tasks: folders.yml
tags: [docker, docker_compose]
- name: Update bashrc for pipsi scripts
lineinfile:
dest: "{{ home_dir }}/.bashrc"
line: "export PATH=$PATH:{{ home_dir }}/.local/bin"

- name: Create folders for docker-compose
file:
Expand All @@ -20,3 +24,11 @@
- '{{ dockers_volumes_dir }}'
- '{{ dockers_config_dir }}'
- '{{ dockers_env_dir }}'

- name: docker-compose.yml template file
copy:
src: docker-compose.yml
dest: "{{ docker_compose_filepath }}"
owner: "{{ user }}"
group: "docker"
mode: 0640

0 comments on commit 93c9d7f

Please sign in to comment.