mirror of
https://github.com/kasmtech/ansible
synced 2024-12-12 13:02:32 +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
|
||||
- web
|
||||
- agent
|
||||
- guac
|
||||
roles:
|
||||
- install_common
|
||||
any_errors_fatal: true
|
||||
|
|
|
@ -4,3 +4,5 @@ ubuntu18-web
|
|||
ubuntu18-db
|
||||
[agent]
|
||||
ubuntu18-agent
|
||||
[guac]
|
||||
ubuntu18-guac
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
- db
|
||||
- web
|
||||
- agent
|
||||
- guac
|
||||
roles:
|
||||
- patch_os
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
- 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
|
||||
become: true
|
||||
retries: 20
|
||||
|
@ -8,7 +8,7 @@
|
|||
when: test is not defined
|
||||
|
||||
- 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
|
||||
become: true
|
||||
retries: 20
|
||||
|
|
|
@ -29,4 +29,9 @@
|
|||
when: manager_token is not defined
|
||||
run_once: true
|
||||
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"
|
||||
- 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
|
||||
service:
|
||||
name: docker
|
||||
|
@ -104,6 +111,7 @@
|
|||
- "Database Password: {{ database_password }}"
|
||||
- "Redis Password: {{ redis_password }}"
|
||||
- "Manager Token: {{ manager_token }}"
|
||||
- "Guac Token: {{ guac_token }}"
|
||||
- "user@kasm.local password: {{ user_password }}"
|
||||
- "admin@kasm.local password: {{ admin_password }}"
|
||||
run_once: true
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
- db
|
||||
- web
|
||||
- agent
|
||||
- guac
|
||||
serial: 1
|
||||
gather_facts: no
|
||||
tasks:
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
- db
|
||||
- web
|
||||
- agent
|
||||
- guac
|
||||
roles:
|
||||
- uninstall
|
||||
|
|
Loading…
Reference in a new issue