-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛🚧 fix docker and docker-compose installation
- Loading branch information
Showing
4 changed files
with
109 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
|
||
- name: Install docker dependencies | ||
apt: | ||
name: '{{ item }}' | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
with_items: | ||
- apt-transport-https | ||
- ca-certificates | ||
- curl | ||
- software-properties-common | ||
|
||
- name: Fetch Docker’s official GPG key | ||
get_url: | ||
url: https://download.docker.com/linux/ubuntu/gpg | ||
dest: docker_apt.key | ||
validate_certs: false | ||
|
||
- name: Add Docker’s official GPG key | ||
apt_key: | ||
file: docker_apt.key | ||
state: present | ||
|
||
- name: Add Docker's official APT repository | ||
command: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
|
||
- name: | ||
apt: | ||
name: '{{ item }}' | ||
update_cache: yes | ||
with_items: | ||
- docker-ce | ||
|
||
- name: Add docker group | ||
group: | ||
name: docker | ||
state: present | ||
|
||
- name: Add user to docker group | ||
user: | ||
name: "{{ user }}" | ||
groups: docker | ||
append: yes | ||
|
||
- name: Change a few ownerships to root:docker | ||
file: | ||
path: '{{ item }}' | ||
owner: root | ||
group: docker | ||
with_items: | ||
- /var/run/docker.sock | ||
- /usr/bin/docker | ||
|
||
- name: Restart the docker daemon | ||
service: | ||
name: docker | ||
state: restarted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
|
||
- name: Install dependencies | ||
apt: | ||
name: '{{ item }}' | ||
update_cache: yes | ||
cache_valid_time: 3600 | ||
with_items: | ||
- build-essential | ||
- libssl-dev | ||
- python-dev | ||
- python3 | ||
- python3-pip | ||
|
||
- name: Install docker-compose | ||
pip: | ||
name: '{{ item }}' | ||
state: forcereinstall | ||
with_items: | ||
- cryptography=={{ pip_cryptography_version }} | ||
- docker-compose=={{ pip_docker_compose_version }} | ||
executable: pip3 | ||
|
||
- name: docker-compose.yml template file | ||
copy: | ||
src: docker-compose.yml | ||
dest: "{{ docker_compose_filepath }}" | ||
owner: "{{ user }}" | ||
group: "docker" | ||
mode: 0640 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The pip install through apt should remove the need to the pip installation in the python role.