Browse Source

Move around config, add varnish

master
Simon Vikstrom 11 months ago
parent
commit
e204cec5d1
8 changed files with 42 additions and 12 deletions
  1. +2
    -0
      group_vars/varnishproxys.yml
  2. +3
    -0
      host_vars/ansibletest.devsn.se.yml
  3. +3
    -0
      inventory
  4. +0
    -12
      lxchosts.yml
  5. +2
    -0
      roles/varnish/tasks/main.yml
  6. +26
    -0
      roles/varnish/tasks/setup-apt.yml
  7. +1
    -0
      site.yml
  8. +5
    -0
      varnish-proxy.yml

+ 2
- 0
group_vars/varnishproxys.yml View File

@@ -0,0 +1,2 @@
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q root@ansibletest.devsn.se"'


+ 3
- 0
host_vars/ansibletest.devsn.se.yml View File

@@ -9,3 +9,6 @@ lxc_containers:
testhost3.xil.se:
ipv4_address: "10.10.0.14/24"
ipv4_gateway: "10.10.0.1"
webcache1.xil.se:
ipv4_address: "10.10.0.15/24"
ipv4_gateway: "10.10.0.1"

+ 3
- 0
inventory View File

@@ -5,3 +5,6 @@ ansibletest.devsn.se
testhost.xil.se ansible_host=10.10.0.12
testhost2.xil.se ansible_host=10.10.0.13
testhost3.xil.se ansible_host=10.10.0.14

[varnishproxys]
webcache1.xil.se ansible_host=10.10.0.15

+ 0
- 12
lxchosts.yml View File

@@ -2,15 +2,3 @@
roles:
- common
- lxchost
vars:
lxc_containers:
testhost.xil.se:
ipv4_address: "10.10.0.12/24"
ipv4_gateway: "10.10.0.1"
testhost2.xil.se:
ipv4_address: "10.10.0.13/24"
ipv4_gateway: "10.10.0.1"
testhost3.xil.se:
ipv4_address: "10.10.0.14/24"
ipv4_gateway: "10.10.0.1"


+ 2
- 0
roles/varnish/tasks/main.yml View File

@@ -0,0 +1,2 @@
---
- import_tasks: setup-apt.yml

+ 26
- 0
roles/varnish/tasks/setup-apt.yml View File

@@ -0,0 +1,26 @@
---
- name: Ensure APT HTTPS Transport is installed.
apt:
name: apt-transport-https
state: present

- name: Add packagecloud.io Varnish apt key.
apt_key:
url: https://packagecloud.io/varnishcache/{{ varnish_packagecloud_repo }}/gpgkey
state: present

- name: Add packagecloud.io Varnish apt repository.
apt_repository:
repo: "{{ varnish_apt_repo }}"
state: present

- name: Ensure Varnish is installed.
apt:
name: "{{ varnish_package_name }}"
state: present

- name: Ensure old role-managed Varnish systemd unit file is removed.
file:
path: /etc/systemd/system/varnish.service
state: absent
when: varnish_systemd_config_path != '/etc/systemd/system'

+ 1
- 0
site.yml View File

@@ -1,3 +1,4 @@
---
- import_playbook: lxchosts.yml
- import_playbook: lxcguests.yml
- import_playbook: varnish-proxy.yml

+ 5
- 0
varnish-proxy.yml View File

@@ -0,0 +1,5 @@
- hosts: varnishproxys
roles:
- common
- varnish


Loading…
Cancel
Save