Add testing inventory and group variables
Added fully test-ready inventory and groups using vagrant and able to run repeatedly as necessary.
This commit is contained in:
parent
9f188c2674
commit
6de8f0fb50
7 changed files with 46 additions and 1 deletions
16
README.md
Normal file
16
README.md
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Cloudserve infrastructure
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
This repository comes with a test-ready setup to try out the complete site setup locally.
|
||||||
|
It uses vagrant to accomplish this and create a pretend target host.
|
||||||
|
So, install [vagrant](https://www.vagrantup.com/) on your system and to make tests repeatable also install the vagrant plugins `vagrant-hosts` and `vagrant-hostsupdater`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
vagrant plugin install vagrant-hosts vagrant-hostsupdater
|
||||||
|
```
|
||||||
|
|
||||||
|
Then you are ready to run the complete infrastructure setup locally,
|
||||||
|
simply by executing `ansible-playbook site.yml`.
|
||||||
|
You can of course pick and choose what should be executed with host limits, tags, group variables, and so on,
|
||||||
|
but this should provide an easy way to see if a) the playbook is working as intended and b) what it does is useful.
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
[defaults]
|
[defaults]
|
||||||
|
|
||||||
inventory = ./inv-staging.yml
|
inventory = ./staging.yml
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
docker_swarm_advertise_addr: eth1
|
docker_swarm_advertise_addr: eth1
|
||||||
|
|
||||||
|
caddy_use_debug: yes
|
||||||
|
caddy_use_https: no
|
||||||
|
caddy_tls_use_staging: yes
|
||||||
|
caddy_create_test_file_server: yes
|
||||||
|
|
|
||||||
5
host_vars/tau.yml
Normal file
5
host_vars/tau.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
ansible_host: 192.168.27.2
|
||||||
|
ansible_ssh_user: vagrant
|
||||||
|
ansible_ssh_private_key_file: "{{ playbook_dir }}/.vagrant/machines/tau/virtualbox/private_key"
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
become: true
|
become: true
|
||||||
|
tags:
|
||||||
|
- fs
|
||||||
|
|
||||||
- name: Ensure Caddyfile exists
|
- name: Ensure Caddyfile exists
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
@ -14,6 +16,8 @@
|
||||||
dest: "{{ caddy_caddyfile_dir }}/Caddyfile"
|
dest: "{{ caddy_caddyfile_dir }}/Caddyfile"
|
||||||
validate: "docker run --rm -v %s:/Caddyfile caddy caddy validate --config /Caddyfile"
|
validate: "docker run --rm -v %s:/Caddyfile caddy caddy validate --config /Caddyfile"
|
||||||
become: true
|
become: true
|
||||||
|
tags:
|
||||||
|
- fs
|
||||||
|
|
||||||
- name: Deploy caddy to swarm
|
- name: Deploy caddy to swarm
|
||||||
community.general.docker_stack:
|
community.general.docker_stack:
|
||||||
|
|
@ -25,3 +29,5 @@
|
||||||
with_items: "{{ caddy_stack }}"
|
with_items: "{{ caddy_stack }}"
|
||||||
when: caddy_stack is defined
|
when: caddy_stack is defined
|
||||||
become: yes
|
become: yes
|
||||||
|
tags:
|
||||||
|
- docker-swarm
|
||||||
|
|
|
||||||
|
|
@ -30,3 +30,5 @@
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
become: true
|
become: true
|
||||||
|
tags:
|
||||||
|
- fs
|
||||||
|
|
|
||||||
11
staging.yml
Normal file
11
staging.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
stable:
|
||||||
|
hosts:
|
||||||
|
tau:
|
||||||
|
|
||||||
|
docker_swarm_manager_node:
|
||||||
|
hosts:
|
||||||
|
tau:
|
||||||
|
|
||||||
|
testing:
|
||||||
|
hosts:
|
||||||
|
tau:
|
||||||
Loading…
Add table
Add a link
Reference in a new issue