From 68f13e3f9c6025e0533cd5f92adb97950e44f4c5 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Sun, 30 Dec 2018 20:48:54 +0000 Subject: [PATCH] Add a proxy feature and clean up playbooks. --- README.md | 15 ++++++++++++--- molecule/alpine-edge/playbook.yml | 5 +++++ molecule/alpine-latest/playbook.yml | 7 ++++++- molecule/archlinux/playbook.yml | 4 ++++ molecule/centos-6/playbook.yml | 5 +++++ molecule/centos-latest/playbook.yml | 7 ++++++- molecule/debian-latest/playbook.yml | 7 ++++++- molecule/debian-stable/playbook.yml | 4 ++++ molecule/debian-unstable/playbook.yml | 4 ++++ molecule/default/playbook.yml | 9 ++++++++- molecule/ec2/playbook.yml | 9 ++++++++- molecule/fedora-latest/playbook.yml | 7 ++++++- molecule/fedora-rawhide/playbook.yml | 4 ++++ molecule/opensuse-leap/playbook.yml | 4 ++++ molecule/opensuse-tumbleweed/playbook.yml | 4 ++++ molecule/ubuntu-artful/playbook.yml | 4 ++++ molecule/ubuntu-devel/playbook.yml | 4 ++++ molecule/ubuntu-latest/playbook.yml | 7 ++++++- molecule/vagrant/playbook.yml | 6 ++++++ templates/location.conf.j2 | 3 +++ 20 files changed, 109 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index e86dfe2..0b222cb 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,12 @@ Example Playbook ---------------- This example is taken from `molecule/default/playbook.yml`: -``` +```yaml --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -23,9 +24,15 @@ This example is taken from `molecule/default/playbook.yml`: - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.epel + - robertdebock.buildtools - robertdebock.python_pip - robertdebock.httpd @@ -35,7 +42,7 @@ Role Variables -------------- These variables are set in `defaults/main.yml`: -``` +```yaml --- # defaults file for httpd @@ -69,12 +76,14 @@ Requirements The following roles can be installed to ensure all requirements are met, using `ansible-galaxy install -r requirements.yml`: +```yaml --- - robertdebock.bootstrap - robertdebock.buildtools - robertdebock.epel - robertdebock.python_pip +``` Context ------- diff --git a/molecule/alpine-edge/playbook.yml b/molecule/alpine-edge/playbook.yml index 04c48c3..94c5048 100644 --- a/molecule/alpine-edge/playbook.yml +++ b/molecule/alpine-edge/playbook.yml @@ -12,8 +12,13 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.buildtools - robertdebock.python_pip - ansible-role-httpd diff --git a/molecule/alpine-latest/playbook.yml b/molecule/alpine-latest/playbook.yml index 8f22a17..94c5048 100644 --- a/molecule/alpine-latest/playbook.yml +++ b/molecule/alpine-latest/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/archlinux/playbook.yml b/molecule/archlinux/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/archlinux/playbook.yml +++ b/molecule/archlinux/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/centos-6/playbook.yml b/molecule/centos-6/playbook.yml index 04c48c3..63e1948 100644 --- a/molecule/centos-6/playbook.yml +++ b/molecule/centos-6/playbook.yml @@ -12,8 +12,13 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.epel - robertdebock.python_pip - ansible-role-httpd diff --git a/molecule/centos-latest/playbook.yml b/molecule/centos-latest/playbook.yml index bc39099..63e1948 100644 --- a/molecule/centos-latest/playbook.yml +++ b/molecule/centos-latest/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/debian-latest/playbook.yml b/molecule/debian-latest/playbook.yml index 033c51c..30cf938 100644 --- a/molecule/debian-latest/playbook.yml +++ b/molecule/debian-latest/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/debian-stable/playbook.yml b/molecule/debian-stable/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/debian-stable/playbook.yml +++ b/molecule/debian-stable/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/debian-unstable/playbook.yml b/molecule/debian-unstable/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/debian-unstable/playbook.yml +++ b/molecule/debian-unstable/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/default/playbook.yml b/molecule/default/playbook.yml index 033c51c..9f769a7 100644 --- a/molecule/default/playbook.yml +++ b/molecule/default/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,8 +12,14 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.epel + - robertdebock.buildtools - robertdebock.python_pip - ansible-role-httpd diff --git a/molecule/ec2/playbook.yml b/molecule/ec2/playbook.yml index 033c51c..9f769a7 100644 --- a/molecule/ec2/playbook.yml +++ b/molecule/ec2/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,8 +12,14 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.epel + - robertdebock.buildtools - robertdebock.python_pip - ansible-role-httpd diff --git a/molecule/fedora-latest/playbook.yml b/molecule/fedora-latest/playbook.yml index 033c51c..30cf938 100644 --- a/molecule/fedora-latest/playbook.yml +++ b/molecule/fedora-latest/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/fedora-rawhide/playbook.yml b/molecule/fedora-rawhide/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/fedora-rawhide/playbook.yml +++ b/molecule/fedora-rawhide/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/opensuse-leap/playbook.yml b/molecule/opensuse-leap/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/opensuse-leap/playbook.yml +++ b/molecule/opensuse-leap/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/opensuse-tumbleweed/playbook.yml b/molecule/opensuse-tumbleweed/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/opensuse-tumbleweed/playbook.yml +++ b/molecule/opensuse-tumbleweed/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/ubuntu-artful/playbook.yml b/molecule/ubuntu-artful/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/ubuntu-artful/playbook.yml +++ b/molecule/ubuntu-artful/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/ubuntu-devel/playbook.yml b/molecule/ubuntu-devel/playbook.yml index 04c48c3..30cf938 100644 --- a/molecule/ubuntu-devel/playbook.yml +++ b/molecule/ubuntu-devel/playbook.yml @@ -12,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/ubuntu-latest/playbook.yml b/molecule/ubuntu-latest/playbook.yml index 033c51c..30cf938 100644 --- a/molecule/ubuntu-latest/playbook.yml +++ b/molecule/ubuntu-latest/playbook.yml @@ -1,7 +1,8 @@ --- - name: Converge hosts: all - gather_facts: false + gather_facts: no + become: yes vars: httpd_applications: @@ -11,6 +12,10 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap diff --git a/molecule/vagrant/playbook.yml b/molecule/vagrant/playbook.yml index 04c48c3..9f769a7 100644 --- a/molecule/vagrant/playbook.yml +++ b/molecule/vagrant/playbook.yml @@ -12,8 +12,14 @@ - name: myotherapp location: myotherapp backend_url: http://localhost:8080/myotherapp + - name: fedoraproxy + location: fedoraproxy + backend_url: http://dl.fedoraproject.org/pub/fedora/linux/ + remote: http://localhost:3128/ roles: - robertdebock.bootstrap + - robertdebock.epel + - robertdebock.buildtools - robertdebock.python_pip - ansible-role-httpd diff --git a/templates/location.conf.j2 b/templates/location.conf.j2 index d6144a2..f16d881 100644 --- a/templates/location.conf.j2 +++ b/templates/location.conf.j2 @@ -2,4 +2,7 @@ ProxyPass {{ item.backend_url }} ProxyPassReverse {{ item.backend_url }} +{% if item.remote is defined %} + ProxyRemote * {{ item.remote }} +{% endif %}