Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
59d389e
add mariadb playbook and add comment
crosmuller Jul 7, 2025
c89d690
hosts all for secrets
crosmuller Jul 7, 2025
7805394
mysql standalone group
crosmuller Jul 7, 2025
b60d8f4
explain run_once
crosmuller Jul 7, 2025
8271d3e
add comment
crosmuller Jul 10, 2025
9be057c
no users on arbitrator
crosmuller Jul 10, 2025
8438ecc
avoid galera issues
crosmuller Jul 10, 2025
6a14d78
change comment
crosmuller Jul 11, 2025
0bf4179
mongo playbook
crosmuller Jul 24, 2025
7866dc8
mongo playbook newline
crosmuller Jul 24, 2025
f96ea7b
add some debug info
crosmuller Jul 24, 2025
b264ee3
do not limit members when -l option is used
crosmuller Jul 24, 2025
44a6cd2
loop over group
crosmuller Jul 24, 2025
96ac508
typo
crosmuller Jul 24, 2025
2294132
mongoservers
crosmuller Jul 24, 2025
9733e01
fix value does not exist error
crosmuller Jul 24, 2025
d93d70f
members
crosmuller Jul 25, 2025
f9aea91
add notes
crosmuller Aug 18, 2025
9f78658
remove filter
crosmuller Aug 18, 2025
e6eda83
Merge branch 'main' into fix/new_tagless_playbooks
crosmuller Aug 18, 2025
95c16ff
move group_vars
crosmuller Aug 28, 2025
2cda9ab
move group_vars
crosmuller Aug 28, 2025
bef9dc1
rename and move playbooks
crosmuller Aug 29, 2025
cc94bc1
add spdashboard
crosmuller Sep 3, 2025
e208070
remove playbook
crosmuller Sep 10, 2025
3c561ef
fix merge conflict
crosmuller Sep 11, 2025
b398307
move test playbooks
crosmuller Sep 12, 2025
5acf0d8
delete moved task list
crosmuller Sep 12, 2025
2946743
change haproxy playbook name
crosmuller Oct 6, 2025
1bc0058
fix merge issues
crosmuller Oct 8, 2025
c975f59
move haproxy script
crosmuller Nov 17, 2025
a5919d4
remove import
crosmuller Nov 19, 2025
09223e9
simplify provision playbook and inventory
crosmuller Dec 8, 2025
8a3f335
main merge
crosmuller Dec 17, 2025
6a627cd
explain mariadb groups
crosmuller Dec 17, 2025
ec0a407
inventory dir always works
crosmuller Dec 18, 2025
3f82817
adjust readme for the new setup
crosmuller Dec 18, 2025
d95475d
adjust inventory
crosmuller Dec 18, 2025
a26f4f4
elk was just for inspiration so we leave it out of the inventory
crosmuller Dec 18, 2025
ddc6c75
remove comment
crosmuller Dec 18, 2025
e61ce9f
line breaks
crosmuller Dec 18, 2025
47f76a2
escape slashes
crosmuller Dec 18, 2025
7a64635
clarification
crosmuller Dec 18, 2025
15e8a11
typo
crosmuller Dec 18, 2025
a269de6
remove selfsigned
crosmuller Dec 18, 2025
0fae959
add mysql group
crosmuller Dec 18, 2025
79b2171
rename secrets
crosmuller Dec 18, 2025
d03dbd7
explain secrets
crosmuller Dec 18, 2025
fb3b699
one mongo group is enough
crosmuller Dec 18, 2025
fb31333
alfabetize
crosmuller Dec 18, 2025
bd028c5
name plays, put tags on play not role
crosmuller Dec 18, 2025
4903d3e
found a todo
crosmuller Dec 22, 2025
8a80a54
add ask vault password
crosmuller Dec 22, 2025
8302371
breing back prep-env for now
crosmuller Jan 12, 2026
f639334
complete changelog
crosmuller Jan 12, 2026
678906c
fix merge conflict
crosmuller Jan 15, 2026
dc5fe3e
fixed merge conflicts
crosmuller Feb 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

### Changed
- All group_var files are moved to the environment example template, more information about where to save group_vars in the [README](https://github.com/OpenConext/OpenConext-deploy/blob/main/README.md)
- separate plays for separate roles in the provision.yml playbook
- seperate groups are defined for separate apps, dividing apps across the container servers should be set in the inventory not in the playbook, this way you can easily change it for different environments. This also makes it impossible to use the wrong tag and deploy something you did not intend to, instead nothing will happen.
- mysql_standalone group replaces storage group

### Removed
- selfsigned_certs role is deprecated and removed from the provision.yml playbook
- environment/playbook inclusion in provision.yml

### Todo
- [ ] Complete environments/template
97 changes: 75 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ Every application has a seperate role to install it. The following roles can be
| stepupra | Stepup ra interface |
| stepupselfservice | Stepup selfservice interface |

All these applications run in Docker. You can use the "docker" role to install docker and Traefik. The result is a Docker application server, with port 443 open. Applications are served by Traefik and recognized on basis of a Host: header. If you run a small installation, you can add a https certificate to Traefik and run a single node application server.
All these applications run in Docker. You can use the "docker" role to install docker and Traefik. The result is a Docker application server, with port 443 open. Applications are served by Traefik and recognized on basis of a Host: header. If you run a small installation, you can add a https certificate to Traefik and run a single node application server.

For a fully functioning environment you also need a MariaDB database server and a Mongo database server.
For a fully functioning environment you also need a MariaDB database server and a Mongo database server.

## Infra roles
This repository is used for deployment of SURFconext, and several roles that the SURFconext teams uses to provision our infrastructure are provided here as well. You can use them for your own infrastructure or use them as inspiration.
This repository is used for deployment of SURFconext, and several roles that the SURFconext teams uses to provision our infrastructure are provided here as well. You can use them for your own infrastructure or use them as inspiration.
| name | remarks |
| --- | --- |
| bind | DNS server for high availability. Very specific for SURFconext |
Expand All @@ -59,40 +59,93 @@ This repository is used for deployment of SURFconext, and several roles that the
| mongo | Install a mongo cluster (has its own README) |
| manage_provision_entities|Provision entities to Manage |

# Environment specific variables
Many variables can be overridden to create a setup suitable for your needs. The environment should be placed in the directory environments_external.
# Setting up your environment
Many variables can be overridden to create a setup suitable for your needs. We will explain the setup here for one environment or for a multi-environment (OTAP for example) setup.

A script is available to provision a new environment. It will create a new environment directory under environments-external/ and it will create all necessary passwords and (self-signed) certificates. Replace <environment> with the name of the target. Replace <domain> with the domain of the target.
The setup descibed below should work, but when using ansible many paths lead to Rome. If you want to know more about variables and where to save them, this can be helpfull: https://docs.ansible.com/projects/ansible/latest/playbook_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

## Inventory
You need an inventory file for your environment or multiple inventory files if you have multiple environments. An example can be found in environments/template

## Playbook
You can use the provision.yml script to deploy all infra and application roles. Every play has a tag so you can deploy your environment one application at a time by using the specific tag. You can also use your own playbooks if you prefer.

## First steps
Clone the repository with git.

```bash
cd yourdir
git clone https://github.com/OpenConext/OpenConext-deploy.git
```
/prep-env <environment> <domain>
```
Then run
```
cp environments-external/<environment>/host_vars/template.yml environments-external/<environment>/host_vars/<target_ip>.yml
```
(where <target_ip> is the ip address or hostname of your target machine, whatever is set in your inventory file)

Change in environments-external/<environment>/inventory:
Change all references from %target_host% to <target_ip>
Create ansible.cfg in your directory and add Openconext-deploy/roles to your roles_path

```bash
[defaults]
diff = true
roles_path = OpenConext-deploy/roles # Add your own roles directory if you want
```
Please note that this has not been tested in quite a while. You will need a lot of manual work to get this environment working

## One environment
Copy the inventory, host and group files from environment/template to your directory and adjust them according to your preferences:

```bash
cp -R OpenConext-deploy/environments/template/* .
```

Edit your inventory file
Edit group_var and host_var files if necessary

Create an ansible vault in secrets and name it secrets.yml, an unencrypted example can be found in secrets/secret_example.yml
More information about vaults: https://docs.ansible.com/projects/ansible/latest/vault_guide/index.html
The final setup will look like this:

# Playbooks, tags and the provision wrapper script
- group_vars/all.yml
- group_vars/\<GROUPNAME\>.yml
- secrets/secrets.yml
- host_vars/\<HOSTNAME\>/yml
- inventory
- Openconext-deploy/provision.yml
- Openconext-deploy/roles
- \<YOUROWNOPTIONALPLAYBOOKS\>.yml
- ansible.cfg

Two playbooks exist in this repository: provision.yml and playbook_haproxy.yml. The latter can be used to do red/blue deployments if you also use our haproxy role.
The main playbook is provision.yml. It contains series of plays to install every role on the right node. All roles are tagged, so you can use the [Ansible tag mechanism](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_tags.html) to deploy a specific role.
You can use the provision playbook now:

If you would like to deploy manage to your test environment, you would run:
```bash
ansible-playbook OpenConext-deploy/provision.yml -i inventory -t <TAG> --ask-vault-password
```
ansible-playbook -i environments-external/test/inventory --tags manage -u THE_REMOTE_SSH_USER_WITH_SUDO_PERMISSIONS

## Multi-environment
Copy the inventory and group files from environment/template to your directory and adjust them according to your preferences:

```bash
mkdir <ENVIRONMENT> # test for example
cp -R OpenConext-deploy/environments/template/* <ENVIRONMENT>
# etc...
```
Edit your inventory files
Edit group_var and host_var files if necessary

For each environment create an ansible vault in secrets and name it secrets.yml, an unencrypted example can be found in secrets/secret_example.yml
More information about vaults: https://docs.ansible.com/projects/ansible/latest/vault_guide/index.html

The final setup will look like this:

A wrapper script which enables you to use your own roles can be used as well. That is documented here: https://github.com/OpenConext/OpenConext-deploy/wiki/Add-your-own-roles-and-playbooks
- \<ENVIRONMENT\>/group_vars/all.yml
- \<ENVIRONMENT\>/group_vars/\<GROUPNAME\>.yml
- \<ENVIRONMENT\>/host_vars/\<HOSTNAME\>/yml
- \<ENVIRONMENT\>/inventory
- Openconext-deploy/provision.yml
- Openconext-deploy/roles
- \<YOUROWNOPTIONALPLAYBOOKS\>.yml
- ansible.cfg

You can use the provision playbook now:

```bash
ansible-playbook OpenConext-deploy/provision.yml -i <ENVIRONMENT>/inventory -t <TAG> --ask-vault-password
```

# License

Expand Down
171 changes: 0 additions & 171 deletions deploy_containers_playbook.yml

This file was deleted.

16 changes: 0 additions & 16 deletions deploy_docker_playbook.yml

This file was deleted.

28 changes: 0 additions & 28 deletions deploy_loadbalancers_playbook.yml

This file was deleted.

1 change: 0 additions & 1 deletion deploy_mariadb_playbook.yml

This file was deleted.

1 change: 0 additions & 1 deletion deploy_mongo_playbook.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading