refactoring and cleanup
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
167ef0f6e3
commit
58470c2fb9
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,6 @@
|
|||||||
# ---> Ansible
|
# ---> Ansible
|
||||||
*.retry
|
*.retry
|
||||||
filter/plugins/
|
plugins
|
||||||
library
|
library
|
||||||
|
|
||||||
# ---> Python
|
# ---> Python
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
dockerengine_package: docker
|
dockerengine_packages:
|
||||||
|
- docker
|
||||||
|
|
||||||
# @var dockerengine_packages_extra:description: >
|
# @var dockerengine_packages_extra:description: >
|
||||||
# The role requires epel repository and pip to work .You can use
|
# The role requires epel repository and pip to work .You can use
|
||||||
@ -8,6 +9,11 @@ dockerengine_package: docker
|
|||||||
# @var dockerengine_packages_extra:example: $ ["epel-release", "python2-pip"]
|
# @var dockerengine_packages_extra:example: $ ["epel-release", "python2-pip"]
|
||||||
dockerengine_packages_extra: []
|
dockerengine_packages_extra: []
|
||||||
|
|
||||||
|
dockerengine_packages_python:
|
||||||
|
- name: docker-compose
|
||||||
|
|
||||||
|
dockerengine_service: docker
|
||||||
|
|
||||||
dockerengine_docker_group_enabled: False
|
dockerengine_docker_group_enabled: False
|
||||||
dockerengine_secure_registries: []
|
dockerengine_secure_registries: []
|
||||||
dockerengine_insecure_registries: []
|
dockerengine_insecure_registries: []
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
---
|
---
|
||||||
- name: Restart docker engine
|
- name: Restart docker engine
|
||||||
systemd:
|
service:
|
||||||
state: restarted
|
state: restarted
|
||||||
name: "{{ dockerengine_package }}"
|
name: "{{ dockerengine_service }}"
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
enabled: yes
|
enabled: yes
|
||||||
listen: __docker_restart
|
listen: __docker_restart
|
||||||
|
@ -1,23 +1,5 @@
|
|||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: Install docker engine
|
|
||||||
package:
|
|
||||||
name: "{{ dockerengine_package }}"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
package:
|
|
||||||
name: "{{ item }}"
|
|
||||||
state: present
|
|
||||||
loop: "{{ dockerengine_packages_extra }}"
|
|
||||||
|
|
||||||
- name: Install python requirements
|
|
||||||
pip:
|
|
||||||
name: "{{ item.name }}"
|
|
||||||
executable: "{{ item.exec | default(omit) }}"
|
|
||||||
state: present
|
|
||||||
loop: "{{ __docker_python_requirements }}"
|
|
||||||
|
|
||||||
- name: Add docker group
|
- name: Add docker group
|
||||||
group:
|
group:
|
||||||
name: docker
|
name: docker
|
||||||
@ -33,8 +15,8 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
loop:
|
loop:
|
||||||
- { src: 'etc/sysconfig/docker.j2', dest: '/etc/sysconfig/{{ dockerengine_package }}' }
|
- { src: 'etc/sysconfig/docker.j2', dest: '/etc/sysconfig/{{ dockerengine_service }}' }
|
||||||
- { src: 'etc/sysconfig/docker-storage-setup.j2', dest: '/etc/sysconfig/{{ dockerengine_package }}-storage-setup' }
|
- { src: 'etc/sysconfig/docker-storage-setup.j2', dest: '/etc/sysconfig/{{ dockerengine_service }}-storage-setup' }
|
||||||
- { src: 'etc/containers/registries.conf.j2', dest: '/etc/containers/registries.conf' }
|
- { src: 'etc/containers/registries.conf.j2', dest: '/etc/containers/registries.conf' }
|
||||||
loop_control:
|
loop_control:
|
||||||
label: "{{ item.dest }}"
|
label: "{{ item.dest }}"
|
||||||
@ -71,7 +53,7 @@
|
|||||||
|
|
||||||
- name: Ensure docker engine is up and running
|
- name: Ensure docker engine is up and running
|
||||||
service:
|
service:
|
||||||
name: "{{ dockerengine_package }}"
|
name: "{{ dockerengine_service }}"
|
||||||
enabled: True
|
enabled: True
|
||||||
state: started
|
state: started
|
||||||
become: True
|
become: True
|
30
tasks/install.yml
Normal file
30
tasks/install.yml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
- block:
|
||||||
|
- name: Install dependencies
|
||||||
|
package:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
loop: "{{ dockerengine_packages_extra }}"
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name: "{{ dockerengine_packages }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Install python packages
|
||||||
|
pip:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
executable: "{{ item.exec | default('/usr/bin/pip3') }}"
|
||||||
|
state: present
|
||||||
|
loop: "{{ dockerengine_packages_python }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
|
become: True
|
||||||
|
become_user: root
|
||||||
|
|
||||||
|
- name: Install ansible requirements
|
||||||
|
pip:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: present
|
||||||
|
loop:
|
||||||
|
- docker
|
@ -1,2 +1,3 @@
|
|||||||
---
|
---
|
||||||
- include_tasks: setup.yml
|
- include_tasks: install.yml
|
||||||
|
- include_tasks: config.yml
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
__docker_python_requirements:
|
|
||||||
- name: docker
|
|
||||||
- name: docker-compose
|
|
||||||
exec: /usr/bin/pip3
|
|
Loading…
Reference in New Issue
Block a user