From 4457b19137c2dbb85e04ea3b034317d873f20b8b Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Mon, 12 Jun 2023 19:55:24 +0200 Subject: [PATCH] Update 'basic_checks_Sloetjes.yml' --- basic_checks_Sloetjes.yml | 70 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/basic_checks_Sloetjes.yml b/basic_checks_Sloetjes.yml index f972a30..0e9e7ce 100644 --- a/basic_checks_Sloetjes.yml +++ b/basic_checks_Sloetjes.yml @@ -12,8 +12,8 @@ tasks: - name: Check out pricer repository git: - repo: https://github.com/your-username/pricer.git - dest: /path/to/pricer + repo: https://gogs.gtsplab.com:5432/SVIG/pricer.git + dest: /Users/sloetjeswong/pricer - name: Install Python requirements hosts: target_hosts @@ -48,4 +48,68 @@ # Translate the docker run command into the docker_container ansible module with these args: # -v | volumes: # --cgroupns | cgroupns_mode: -# -d | detach: true \ No newline at end of file +# -d | detach: true + +# Adds on 06/12: + +- name: Run pricer container with systemd + hosts: all + become: true + tasks: + - name: Install Docker + apt: + name: docker.io + state: present + + - name: Start Docker service + service: + name: docker + state: started + + - name: Run pricer container + docker_container: + name: pricer + image: ubuntu + state: started + restart_policy: always + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + privileged: yes + ports: + - "9515:9515" + command: /sbin/init + +- name: Start snapd and udev in the pricer container + hosts: all + become: true + tasks: + - name: Start snapd and udev + docker_exec: + name: pricer + command: systemctl start snapd udev + +- name: Install chromium using snap in the pricer container + hosts: all + become: true + tasks: + - name: Install chromium + docker_exec: + name: pricer + command: snap install chromium + +- name: Run latest version of scraper + hosts: all + become: true + tasks: + - name: Clone pricer repository + git: + repo: https://github.com/your_username/pricer.git + dest: /Users/sloetjeswong/pricer + version: master + + - name: Install dependencies + pip: + requirements: /Users/sloetjeswong/pricer/requirements.txt + + - name: Run scraper + command: python /Users/sloetjeswong/pricer/fp_merge.py