51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
- name: Basic system checks
|
|
hosts: all
|
|
tasks:
|
|
- name: Check to make sure the package manager is apt
|
|
fail:
|
|
msg: "Package manager is not apt"
|
|
when: "ansible_pkg_mgr != 'apt'"
|
|
|
|
- name: Clone pricer repository
|
|
hosts: target_hosts
|
|
become: yes
|
|
tasks:
|
|
- name: Check out pricer repository
|
|
git:
|
|
repo: https://github.com/your-username/pricer.git
|
|
dest: /path/to/pricer
|
|
|
|
- name: Install Python requirements
|
|
hosts: target_hosts
|
|
become: yes
|
|
tasks:
|
|
- name: Install Python requirements
|
|
pip:
|
|
requirements: /Users/sloetjeswong/pricer/requirements.txt
|
|
|
|
- name: Install Chromium and Selenium
|
|
hosts: target_hosts
|
|
become: yes
|
|
tasks:
|
|
- name: Install Chromium
|
|
apt:
|
|
name: chromium-browser
|
|
state: present
|
|
|
|
- name: Install Selenium
|
|
pip:
|
|
name: selenium
|
|
state: present
|
|
|
|
# Start the container in privileged mode with:
|
|
# docker run --privileged --cgroupns=host -d -v /sys/fs/cgroup:/sys/fs/cgroup:rw dev /lib/systemd/systemd
|
|
# systemctl start snapd
|
|
# systemctl start udev
|
|
# snap install chromium
|
|
# You can use ansible.community.docker to run the container, then do all the above stuff
|
|
# docker_container_exec might be useful
|
|
#
|
|
# Translate the docker run command into the docker_container ansible module with these args:
|
|
# -v | volumes:
|
|
# --cgroupns | cgroupns_mode:
|
|
# -d | detach: true |