Skip to content
This repository was archived by the owner on Oct 8, 2019. It is now read-only.

Commit ebf3ca2

Browse files
committed
Make Xvfb a systemd service rather than launching from profile
1 parent 5ba97e4 commit ebf3ca2

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

Vagrantfile-build

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Vagrant.configure("2") do |config|
2020
vb.cpus = 2
2121
end
2222

23-
# config.vm.provision "ansible" do |ansible|
24-
# ansible.playbook = "playbook.yml"
25-
# end
23+
config.vm.provision "ansible" do |ansible|
24+
ansible.playbook = "playbook.yml"
25+
end
2626

2727
config.vm.provision :shell, :inline => "sudo /vagrant/cleanup.sh"
2828

roles/browsers/files/xvfb.service

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Unit]
2+
Description=virtual frame buffer X server
3+
After=network.target
4+
5+
[Service]
6+
ExecStart=/usr/bin/Xvfb -ac :99
7+
8+
[Install]
9+
WantedBy=multi-user.target

roles/browsers/tasks/main.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
become: yes
33
apt: pkg=xvfb
44

5+
- name: Install Xvfb systemd script
6+
become: yes
7+
copy: src=xvfb.service
8+
dest=/etc/systemd/system/xvfb.service
9+
10+
- name: Enable xvfb.service
11+
become: yes
12+
service: name=xvfb enabled=yes state=started
13+
514
- name: add Google Linux repo signing key
615
become: yes
716
apt_key: id=7FAC5991
@@ -28,15 +37,7 @@
2837
become: yes
2938
copy: src=/tmp/chromedriver dest=/usr/local/bin/chromedriver mode=0755 remote_src=yes
3039

31-
- name: expore display to allow selenium to work
40+
- name: export display to allow selenium to work
3241
lineinfile:
33-
dest: "{{ user_home}}.profile"
42+
dest: "{{ user_home }}.profile"
3443
line: "export DISPLAY=:99"
35-
36-
# This is probably the wrong place for this,
37-
# it should be tied to systemd startup rather
38-
# than a profile thing *I think*.
39-
- name: start Xvfb on login
40-
lineinfile:
41-
dest: "{{ user_home}}.profile"
42-
line: "Xvfb -ac :99 2>/dev/null &"

0 commit comments

Comments
 (0)