added the a preparing ansible playbooks for automating new servers
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
---
|
||||
- name: install dependency
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
loop:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg-agent
|
||||
- software-properties-common
|
||||
|
||||
- name: give GPG key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
environment: "{{ proxy_env }}"
|
||||
|
||||
- name: add docker repo
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu bionic stable
|
||||
state: present
|
||||
environment: "{{ proxy_env }}"
|
||||
|
||||
- name: install docker
|
||||
apt:
|
||||
name: "{{item}}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
loop:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
environment: "{{ proxy_env }}"
|
||||
|
||||
- name: start and enable docker
|
||||
service:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: yes
|
||||
Reference in New Issue
Block a user