ansible-role-calibre/molecule/default/prepare.yml
2023-06-09 15:41:22 +02:00

46 lines
1.3 KiB
YAML

---
- name: "CALIBRE | Prepare dependencies"
hosts: "localhost"
tasks:
- name: "Run ansible-galaxy"
ansible.builtin.command: "ansible-galaxy install --force -r ../requirements.yml"
- name: "CALIBRE | Setup the test machine"
hosts: "calibre"
tasks:
- name: "CALIBRE | Check if /var/run/docker.sock already exists"
ansible.builtin.stat:
path: "/var/run/docker.sock"
register: "docker_sock_stat"
- name: "CALIBRE | Create docker.sock"
ansible.builtin.raw: touch /var/run/docker.sock
become: true
changed_when: false
when: "not docker_sock_stat.stat.exists"
- name: "CALIBRE | Move docker.sock from tmp"
ansible.builtin.raw: >
mount --move /tmp/docker_mounted.sock /var/run/docker.sock
become: true
changed_when: false
when: "not docker_sock_stat.stat.exists"
- name: "CALIBRE | Update apt cache."
ansible.builtin.apt: update_cache=yes cache_valid_time=600
when: "ansible_os_family == 'Debian'"
- name: "CALIBRE | Install python requests"
ansible.builtin.pip:
name:
- "requests"
- "docker"
- "docker-compose"
- name: "CALIBRE | Install docker"
vars:
docker_service_manage: false
ansible.builtin.include_role:
name: "geerlingguy.docker"