반응형
# docker-ce-20.10.5
---
- hosts: all
become: yes
tasks:
- name: "yum install packages"
yum:
name: "{{ item }}"
state: installed
loop:
- epel-release
- yum-utils
- git
- name: "docker repo add"
command: yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- name: "docker install"
yum:
name: "{{ item }}"
state: installed
loop:
- docker-ce-20.10.5
- python3
- python3-pip
- bash-completion
- name: "pip upgrade"
command: pip3 install --upgrade pip
- name: "docker-compose install"
command: pip3 install docker-compose
- name: "env PATH setting"
lineinfile:
dest: /etc/bashrc
line: "{{ item }}"
state: present
with_items:
- PATH=$PATH:/usr/local/bin
- name: "systemctl docker enable"
service:
name: docker
enabled: yes
- name: "docker bash completion download"
command: curl -o /opt/docker_completion.sh https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker
- name: "docker bash completion env setting"
lineinfile:
dest: /etc/bashrc
line: "{{ item }}"
state: present
with_items:
- source /opt/docker_completion.sh
반응형
'Automation Tools > Ansible' 카테고리의 다른 글
Windows Ansible | [Playbook] shutdown, reboot, service (0) | 2022.05.16 |
---|---|
9. ansible | windows winrm을 이용한 ansible 사용 (0) | 2022.04.27 |
8.4 ansible | [playbook] nodejs, npm 설치 (0) | 2021.03.16 |
8.3 ansible | [playbook] centos6 yum repository 변경 (0) | 2021.03.16 |
8.2 ansible | [playbook] Linux service 상태 변경 (0) | 2021.03.16 |