Skip to content

Commit

Permalink
Add a proxy feature and clean up playbooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertdebock committed Dec 30, 2018
1 parent c635811 commit 68f13e3
Show file tree
Hide file tree
Showing 20 changed files with 109 additions and 10 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand All @@ -35,7 +42,7 @@ Role Variables
--------------

These variables are set in `defaults/main.yml`:
```
```yaml
---
# defaults file for httpd

Expand Down Expand Up @@ -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
-------
Expand Down
5 changes: 5 additions & 0 deletions molecule/alpine-edge/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion molecule/alpine-latest/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/archlinux/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions molecule/centos-6/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 6 additions & 1 deletion molecule/centos-latest/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion molecule/debian-latest/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/debian-stable/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/debian-unstable/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
9 changes: 8 additions & 1 deletion molecule/ec2/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
7 changes: 6 additions & 1 deletion molecule/fedora-latest/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/fedora-rawhide/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/opensuse-leap/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/opensuse-tumbleweed/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/ubuntu-artful/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions molecule/ubuntu-devel/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion molecule/ubuntu-latest/playbook.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
- name: Converge
hosts: all
gather_facts: false
gather_facts: no
become: yes

vars:
httpd_applications:
Expand All @@ -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
Expand Down
6 changes: 6 additions & 0 deletions molecule/vagrant/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions templates/location.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
<Location {{ item.location }}>
ProxyPass {{ item.backend_url }}
ProxyPassReverse {{ item.backend_url }}
{% if item.remote is defined %}
ProxyRemote * {{ item.remote }}
{% endif %}
</Location>

0 comments on commit 68f13e3

Please sign in to comment.