This repository has been archived by the owner on Sep 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved atmo-check-novnc to disabled; and copied atmo-check-vnc to atmo…
…-check-novnc to fix webdesktop
- Loading branch information
Showing
9 changed files
with
129 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
# defaults file for atmo-check-vnc | ||
|
||
SSH_PORT_TIMEOUT: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
|
||
- name: set environment variables for legacy systems | ||
set_fact: ansible_python_interpreter=/usr/bin/python | ||
when: ansible_distribution == "CentOS" and ansible_distribution_major_version < '6' | ||
tags: | ||
- vnc | ||
- x | ||
|
||
- name: gather os specific variables | ||
include_vars: "{{ item }}" | ||
with_first_found: | ||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml" | ||
- "{{ ansible_distribution }}.yml" | ||
tags: | ||
- vnc | ||
- x | ||
|
||
# Only install RealVNC Server if VM is NOT headless | ||
- name: verify that X server exists | ||
stat: path={{ XGUI.xsession_path }} | ||
register: xsession | ||
tags: | ||
- vnc | ||
- x | ||
|
||
- name: verify that xterm session exists | ||
stat: path={{ XGUI.xterm_path }} | ||
register: xterm | ||
tags: | ||
- vnc | ||
- x | ||
|
||
- name: check to see if VNC server is running | ||
shell: /bin/ps aux | /bin/grep "/usr/bin/Xvnc-core :1 -auth /home/{{ ATMOUSERNAME }}/" | /bin/grep -v grep | ||
ignore_errors: yes | ||
failed_when: False | ||
register: vnc_state | ||
tags: | ||
- vnc | ||
|
||
- name: check to see if novnc is installed | ||
shell: "{{ CHECK_IF_PACKAGE_INSTALLED }}" | ||
ignore_errors: yes | ||
failed_when: False | ||
register: novnc_state | ||
tags: | ||
- novnc | ||
|
||
- name: check to see if websockify is running | ||
shell: /bin/ps aux | grep "websockify" | grep -v grep | ||
ignore_errors: yes | ||
failed_when: False | ||
register: websockify_state | ||
tags: | ||
- novnc | ||
|
||
- name: Fail if novnc is not installed | ||
action: > | ||
{{ ansible_pkg_mgr }} name={{ NOVNC_PACKAGE }} state=present | ||
tags: | ||
- novnc | ||
|
||
- name: fail if OS does not contain a GUI | ||
fail: msg="OS does NOT have a GUI for VNC to run on." | ||
when: not (xsession.stat.exists and xterm.stat.exists) | ||
tags: | ||
- no-gui | ||
- vnc | ||
|
||
- name: fail when VNC is not running | ||
fail: msg="VNC is NOT running for user '{{ ATMOUSERNAME }}'" | ||
when: vnc_state.stdout == "" | ||
tags: | ||
- vnc | ||
- check-vnc | ||
|
||
- name: fail when novnc is not installed | ||
fail: msg="novnc is not installed for user '{{ ATMOUSERNAME }}'" | ||
when: novnc_state.stdout == "" | ||
tags: | ||
- novnc | ||
- check-novnc | ||
|
||
- name: fail when websockify is not running | ||
fail: msg="Websockify is not running for user '{{ ATMOUSERNAME }}'" | ||
when: websockify_state.stdout == "" | ||
tags: | ||
- novnc | ||
- check-novnc | ||
|
||
# disabled until further notice | ||
#- name: fail if shell can't talk to vm | ||
# wait_for: > | ||
# search_regex=OpenSSH | ||
# port={{ ansible_port }} | ||
# host={{ ansible_host }} | ||
# delay=1 | ||
# timeout={{ SSH_PORT_TIMEOUT }} | ||
# tags: gateone_networking_check | ||
# delegate_to: shell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
XGUI: | ||
xsession_path: /usr/bin/xinit | ||
xterm_path: /usr/bin/xterm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
|
||
XGUI: | ||
xsession_path: /usr/bin/xinit | ||
xterm_path: /usr/bin/Xorg | ||
|
||
NOVNC_PACKAGE: novnc | ||
|
||
CHECK_IF_PACKAGE_INSTALLED: rpm -qa | grep novnc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
|
||
XGUI: | ||
xsession_path: /usr/bin/X | ||
xterm_path: /usr/bin/xinit | ||
|
||
NOVNC_PACKAGE: novnc | ||
|
||
CHECK_IF_PACKAGE_INSTALLED: dpkg -l {{ NOVNC_PACKAGE }} | grep ii |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
--- | ||
# defaults file for atmo-check-vnc | ||
|
||
SSH_PORT_TIMEOUT: 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters