mirror of
https://github.com/kasmtech/ansible
synced 2025-01-18 22:33:57 +00:00
KASM-3051 add guac role to multi install
This commit is contained in:
parent
58eded6906
commit
52be4fb65c
10 changed files with 40 additions and 3 deletions
1
group_vars/guac.yml
Normal file
1
group_vars/guac.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
desired_swap_size: 4g
|
|
@ -2,6 +2,7 @@
|
||||||
- db
|
- db
|
||||||
- web
|
- web
|
||||||
- agent
|
- agent
|
||||||
|
- guac
|
||||||
roles:
|
roles:
|
||||||
- install_common
|
- install_common
|
||||||
any_errors_fatal: true
|
any_errors_fatal: true
|
||||||
|
|
|
@ -4,3 +4,5 @@ ubuntu18-web
|
||||||
ubuntu18-db
|
ubuntu18-db
|
||||||
[agent]
|
[agent]
|
||||||
ubuntu18-agent
|
ubuntu18-agent
|
||||||
|
[guac]
|
||||||
|
ubuntu18-guac
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
- db
|
- db
|
||||||
- web
|
- web
|
||||||
- agent
|
- agent
|
||||||
|
- guac
|
||||||
roles:
|
roles:
|
||||||
- patch_os
|
- patch_os
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
- name: Install database role
|
- name: Install database role
|
||||||
command: "bash {{ tempdir.path }}/kasm_release/install.sh -S db -e -Q {{database_password}} -R {{redis_password}} -U {{user_password}} -P {{admin_password}} -M {{manager_token}} {{ '-s ' ~ service_images_copy.dest if service_images_file }} {{ '-w ' ~ workspace_images_copy.dest if workspace_images_file }}"
|
command: "bash {{ tempdir.path }}/kasm_release/install.sh -S db -e -Q {{database_password}} -R {{redis_password}} -U {{user_password}} -P {{admin_password}} -M {{manager_token}} -W {{guac_token}} {{ '-s ' ~ service_images_copy.dest if service_images_file }} {{ '-w ' ~ workspace_images_copy.dest if workspace_images_file }}"
|
||||||
register: install_output
|
register: install_output
|
||||||
become: true
|
become: true
|
||||||
retries: 20
|
retries: 20
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
when: test is not defined
|
when: test is not defined
|
||||||
|
|
||||||
- name: Install database role - test
|
- name: Install database role - test
|
||||||
command: "bash {{ tempdir.path }}/kasm_release/install.sh -S db -e -I -Q {{database_password}} -R {{redis_password}} -U {{user_password}} -P {{admin_password}} -M {{manager_token}} {{ '-s ' ~ service_images_copy.dest if service_images_file }} {{ '-w ' ~ workspace_images_copy.dest if workspace_images_file }}"
|
command: "bash {{ tempdir.path }}/kasm_release/install.sh -S db -e -I -Q {{database_password}} -R {{redis_password}} -U {{user_password}} -P {{admin_password}} -M {{manager_token}} -W {{guac_token}} {{ '-s ' ~ service_images_copy.dest if service_images_file }} {{ '-w ' ~ workspace_images_copy.dest if workspace_images_file }}"
|
||||||
register: install_output
|
register: install_output
|
||||||
become: true
|
become: true
|
||||||
retries: 20
|
retries: 20
|
||||||
|
|
|
@ -30,3 +30,8 @@
|
||||||
run_once: true
|
run_once: true
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
guac_token: "{{ lookup('password', '/dev/null chars=ascii_letters,digits length=22') }}"
|
||||||
|
when: guac_token is not defined
|
||||||
|
run_once: true
|
||||||
|
delegate_to: localhost
|
||||||
|
|
17
roles/install_common/tasks/guac_install.yml
Normal file
17
roles/install_common/tasks/guac_install.yml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
- name: Check connection from guac to webserver
|
||||||
|
uri:
|
||||||
|
url: "https://{{ web_ip }}/api/__healthcheck"
|
||||||
|
timeout: 5
|
||||||
|
validate_certs: false
|
||||||
|
register: _result
|
||||||
|
until: _result.status == 200
|
||||||
|
retries: 7
|
||||||
|
delay: 5
|
||||||
|
|
||||||
|
- name: Install guac role
|
||||||
|
command: "bash {{ tempdir.path }}/kasm_release/install.sh -S guac -e -p {{ web_ip }} -W {{ guac_token }} {{ '-s ' ~ service_images_copy.dest if service_images_file }}"
|
||||||
|
register: install_output
|
||||||
|
become: true
|
||||||
|
retries: 20
|
||||||
|
delay: 10
|
||||||
|
until: install_output is success or ('Failed to lock apt for exclusive operation' not in install_output.stderr and '/var/lib/dpkg/lock' not in install_output.stderr)
|
|
@ -85,6 +85,13 @@
|
||||||
- "'agent' in group_names"
|
- "'agent' in group_names"
|
||||||
- not kasm_installed
|
- not kasm_installed
|
||||||
|
|
||||||
|
- name: Run Kasm guac install tasks
|
||||||
|
include_tasks:
|
||||||
|
file: guac_install.yml
|
||||||
|
when:
|
||||||
|
- "'guac' in group_names"
|
||||||
|
- not kasm_installed
|
||||||
|
|
||||||
- name: enable the docker service to run at boot
|
- name: enable the docker service to run at boot
|
||||||
service:
|
service:
|
||||||
name: docker
|
name: docker
|
||||||
|
@ -104,6 +111,7 @@
|
||||||
- "Database Password: {{ database_password }}"
|
- "Database Password: {{ database_password }}"
|
||||||
- "Redis Password: {{ redis_password }}"
|
- "Redis Password: {{ redis_password }}"
|
||||||
- "Manager Token: {{ manager_token }}"
|
- "Manager Token: {{ manager_token }}"
|
||||||
|
- "Guac Token: {{ guac_token }}"
|
||||||
- "user@kasm.local password: {{ user_password }}"
|
- "user@kasm.local password: {{ user_password }}"
|
||||||
- "admin@kasm.local password: {{ admin_password }}"
|
- "admin@kasm.local password: {{ admin_password }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
- db
|
- db
|
||||||
- web
|
- web
|
||||||
- agent
|
- agent
|
||||||
|
- guac
|
||||||
serial: 1
|
serial: 1
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
- db
|
- db
|
||||||
- web
|
- web
|
||||||
- agent
|
- agent
|
||||||
|
- guac
|
||||||
roles:
|
roles:
|
||||||
- uninstall
|
- uninstall
|
||||||
|
|
Loading…
Reference in a new issue