Skip to content

Commit

Permalink
Refactor microk8s playbook to follow "new" structure (#1264)
Browse files Browse the repository at this point in the history
* Refactor microk8s playbook to follow structure with shared roles

- Integrates with btrix/deploy role for deploying
- Seperated RedHat and Debian into seperate roles
- Created Common role

- allow running remotely by default
- use 'browsertrix_cloud_home' for charts path
- add additional customizable options to btrix_values.j2 (todo: unify all the templates)
- docs: update to new playbook path

---------
Co-authored-by: Ilya Kreymer <[email protected]>
  • Loading branch information
Chickensoupwithrice authored Oct 12, 2023
1 parent 41c054d commit 834fa72
Show file tree
Hide file tree
Showing 16 changed files with 492 additions and 514 deletions.
52 changes: 0 additions & 52 deletions ansible/group_vars/do/main.yml

This file was deleted.

21 changes: 0 additions & 21 deletions ansible/group_vars/microk8s/btrix_values.j2

This file was deleted.

23 changes: 23 additions & 0 deletions ansible/install_microk8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- hosts: all
gather_facts: yes
become: yes
vars_files:
- inventory/microk8s/group_vars/main.yml
roles:
- microk8s/debian # Change to redhat if using a redhat distro
- microk8s/common
- btrix/deploy

handlers:
- name: Reboot System
ansible.builtin.reboot:
when:
- skip_handlers | default("false") == "false"

- name: microk8s ready
ansible.builtin.command:
cmd: microk8s.status --wait-ready
changed_when: false
when:
- skip_handlers | default("false") == "false"
23 changes: 23 additions & 0 deletions ansible/inventory/microk8s/group_vars/example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
all:
children:
"deploy microk8s":
vars:
browsertrix_mongo_password: "CHANGE ME"
browsertrix_superuser_password: "CHANGE ME"

host_ip: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
domain_name: "{{inventory_hostname }}"
signing_subdomain: "{{ signing_subdomain }}"
signing_authtoken: "{{ 99999999 }}"
enable_signing: true
your_user: sysadmin
ansible_user: sysadmin
cert_email: [email protected]
# crawler_session_size_limit_bytes: 50000000000

crawler_extra_args: "--screenshot view,thumbnail,fullPage"

microk8s_dns_servers:
- 1.1.1.1
- 1.0.0.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
project_name: "default"
ansible_ssh_private_key_file: "~/.ssh/id_rsa"
microk8s_cache_valid_time: 3600
allow_world_readable_tmpfiles: true
Expand All @@ -18,8 +19,8 @@ microk8s_channel: stable

your_user: root # if your cloud provide uses another user change this
browsertrix_cloud_home: "/opt/browsertrix-cloud"
microk8s_user_home: "/home/{{ microk8s_user }}"
microk8s_user: conan # change this to a different user if you don't want conan the deployer
ansible_user_home: "/home/{{ ansible_user }}"
ansible_user: conan # change this to a different user if you don't want conan the deployer
microk8s_plugins:
dns: true # CoreDNS
ingress: true # Ingress controller for external access
Expand Down
3 changes: 3 additions & 0 deletions ansible/inventory/microk8s/hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[microk8s]
127.0.0.1
# Add more hosts here if you want to deploy to multiple nodes
Loading

0 comments on commit 834fa72

Please sign in to comment.