Commit fb9d1653 authored by root's avatar root
Browse files

fix build error on CentOS 7 (2009)

parent 7d922645
--- ---
# tasks file for docker-host # tasks file for docker-host
- name: Install required packages - name: Install required packages
yum: yum:
name: ["yum-utils","device-mapper-persistent-data","lvm2","epel-release","rsync",] name: ["yum-utils","device-mapper-persistent-data","lvm2","epel-release","rsync"]
state: latest state: latest
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
- name: Add Docker repository - name: Add Docker repository
get_url: get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644 mode: 0644
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
- name: Install required packages - name: Install required packages
yum: yum:
name: ["docker-ce","docker-ce-cli","containerd.io","python-pip","unzip","firewalld"] name: ["docker-ce","docker-ce-cli","containerd.io","python-pip","unzip","firewalld","python-docker-py"]
state: latest state: latest
validate_certs: no validate_certs: no
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
- name: Install pip packages - name: Install pip packages
pip: pip:
name: ["docker-py>1.10.0"," pexpect>=3.3"] name: ["pexpect==3.3"]
- name: Set sysctl parameters - name: Set sysctl parameters
sysctl: sysctl:
name: "{{item.key}}" name: "{{item.key}}"
...@@ -33,19 +28,16 @@ ...@@ -33,19 +28,16 @@
sysctl_set: yes sysctl_set: yes
with_items: with_items:
- "{{sysctlconfig}}" - "{{sysctlconfig}}"
- name: Configure fw - name: Configure fw
ansible.posix.firewalld: ansible.posix.firewalld:
rich_rule: "rule family=ipv4 source address={{ soctools_network }} accept" rich_rule: "rule family=ipv4 source address={{ soctools_network }} accept"
permanent: yes permanent: yes
state: enabled state: enabled
- name: Reload firewalld - name: Reload firewalld
systemd: systemd:
state: restarted state: restarted
daemon_reload: yes daemon_reload: yes
name: firewalld name: firewalld
- name: Start Docker service - name: Start Docker service
systemd: systemd:
name: docker name: docker
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment