Cloud_Computing_II/ansible/provision.yml

49 lines
1.4 KiB
YAML
Raw Normal View History

2023-03-21 11:55:49 +00:00
- hosts: all
become: true
tasks:
- name: ensure repository key is installed
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: ensure docker registry is available
apt_repository: repo='deb https://download.docker.com/linux/ubuntu bionic stable' state=present
- name: ensure docker and dependencies are installed
apt:
pkg:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin
- python3-docker
- python3-pip
update_cache: yes
- service: name=docker state=started
- name: Install docker-compose python package
ansible.builtin.pip:
name: docker-compose
- name: clone repository
ansible.builtin.git:
repo: https://git.flokaiser.com/DHBW/Cloud_Computing_II.git
dest: /home/adminuser/Cloud_Computing_II
single_branch: yes
version: main
- name: deploy docker compose stack
community.docker.docker_compose:
project_src: /home/adminuser/Cloud_Computing_II
files:
- docker-compose.yml
environment:
CERTBOT_EMAIL: "{{ CERTBOT_EMAIL }}"
DATABASE_URL: "{{ DATABASE_URL }}"
AZURE_KEY: "{{ AZURE_KEY }}"
AZURE_LOCATION: "{{ AZURE_LOCATION }}"
AZURE_ENDPOINT: "https://api.cognitive.microsofttranslator.com"
2023-04-07 21:12:31 +00:00
ENV: "dev"