Compare commits
6
Commits
46e66a20a1
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afd3361766 | ||
|
|
883ec747ce | ||
|
|
f99458570a | ||
|
|
1988a0f7fa | ||
|
|
104ae2e903 | ||
|
|
bdb2a48a86 |
@@ -0,0 +1,3 @@
|
||||
bin/**
|
||||
lib/**
|
||||
share/**
|
||||
+33
-1
@@ -86,6 +86,8 @@
|
||||
name: selenium
|
||||
state: present
|
||||
|
||||
# Install snapd here
|
||||
|
||||
# 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
|
||||
@@ -163,9 +165,39 @@
|
||||
name: chromium-browser
|
||||
state: present
|
||||
|
||||
- name: Verify the chromium browser is running at the specified port
|
||||
hosts: docker_container
|
||||
become: true
|
||||
tasks:
|
||||
- name: install the net-tools
|
||||
apt:
|
||||
name: net-tools
|
||||
state: present
|
||||
- name: Get Chromium browser port
|
||||
command: netstat -tlnp | grep chromium | awk '{split($4,a,":"); print a[length(a)]}'
|
||||
register: chromium_port
|
||||
- name: Display Chromium browser port
|
||||
debug:
|
||||
var: chromium_port.stdout
|
||||
|
||||
- name: Run latest version of scraper
|
||||
hosts: docker_container
|
||||
become: true
|
||||
tasks:
|
||||
- name: Set up Chrome options
|
||||
set_fact:
|
||||
chrome_options:
|
||||
- "--headless"
|
||||
- "--no-sandbox"
|
||||
- "--disable-dev-shm-usage"
|
||||
- name: Debug chrome_options variable
|
||||
debug:
|
||||
var: chrome_options
|
||||
|
||||
- name: Run scraper
|
||||
command: python3 /opt/pricer/fp_merge.py
|
||||
ansible.builtin.script:
|
||||
script: /opt/pricer/fp2_13.py
|
||||
executable: /usr/bin/python3
|
||||
environment:
|
||||
PATH: "/usr/bin/chromedriver/:{{ ansible_env.PATH }}"
|
||||
CHROME_OPTIONS: "{{ chrome_options | join(' ') }}"
|
||||
@@ -42,7 +42,7 @@ subscription = subscriber.create_subscription(
|
||||
# Publish a message to the topic
|
||||
# Read the data from the csv file
|
||||
# file_path = "C:/Users/Karen/Desktop/zipcodes.csv"
|
||||
file_path = "zipcodes.csv"
|
||||
file_path = "karen-zipcodes.csv"
|
||||
|
||||
with open(file_path, "r") as csv_file:
|
||||
reader = csv.reader(csv_file)
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ ntplib
|
||||
arrow
|
||||
h5py
|
||||
ansible
|
||||
|
||||
ansible-lint
|
||||
|
||||
Reference in New Issue
Block a user