diff --git a/ansible/roles/nookbag/.yamllint b/ansible/roles/nookbag/.yamllint new file mode 100644 index 00000000000..b2a7e1775e9 --- /dev/null +++ b/ansible/roles/nookbag/.yamllint @@ -0,0 +1,13 @@ +--- +extends: default + +rules: + comments: + require-starting-space: false + min-spaces-from-content: 1 + comments-indentation: disable + indentation: + indent-sequences: consistent + line-length: + max: 120 + allow-non-breakable-inline-mappings: true diff --git a/ansible/roles/nookbag/README.adoc b/ansible/roles/nookbag/README.adoc new file mode 100644 index 00000000000..17fd1ac3a59 --- /dev/null +++ b/ansible/roles/nookbag/README.adoc @@ -0,0 +1,49 @@ +== Showroom + +Showroom is an Ansible role that installs and configures Showroom, a replacement for bookbag. +Showroom provides views (1 or more webpages) onto external web based resouces (e.g. websites, webapps, etc.). +It's primary use case is to provide a 1 stop console for demos, workshops, and labs. + +=== Core Concepts + +* Views - a view is a webpage that is displayed in the browser, it can include: +** Demo, lab, workshop content - typically created in asciidoc with Antora or similar +** Tabs (iframed) - internal or external http based services e.g. +*** Terminal(s) (tty) e.g. Butterfly, xtermjs etc +*** IDEs such as VSCode/CodeServer, JupyterNotes etc +*** Consoles e.g. OpenShift, ArgoCD, Automation Controller etc + +NOTE: Consoles are typically iframed into a view, but can be opened in a new tab/window. +Issues *may* arise with iframing some consoles, e.g. OpenShift, ArgoCD, Automation Controller etc and these are actively being investiagted. + + +=== Requirements + +* Ansible 2.9 or higher + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +=== Role Variables + + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +=== Dependencies + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +=== Example Playbook + + + - hosts: servers + roles: + - showroom + +==== License + +BSD + +===== Author Information + +- Tony Kay (tok@redhat.com) + diff --git a/ansible/roles/nookbag/README.md b/ansible/roles/nookbag/README.md new file mode 100644 index 00000000000..225dd44b9fc --- /dev/null +++ b/ansible/roles/nookbag/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/ansible/roles/nookbag/defaults/main.yml b/ansible/roles/nookbag/defaults/main.yml new file mode 100644 index 00000000000..e6400876a7e --- /dev/null +++ b/ansible/roles/nookbag/defaults/main.yml @@ -0,0 +1,35 @@ +--- +# TODO: make this repo generic example + +# Content repo with *optional* tag +nookbag_git_repo: https://github.com/aleixhub/hello-world-lab.git +showroom_nookbag: https://github.com/rhpds/nookbag/archive/refs/tags/nookbag-v0.0.3.zip +showroom_git_tag: main + +showroom_default_playbook: site.yml # Default antora playbook to build from + +showroom_user: showroom +showroom_group: showroom +showroom_home_dir: /opt/showroom # Also base dir for all things showroom + +showroom_container_compose_template: main_compose_template.j2 + +showroom_tab_services: + - double_terminal + - codeserver + - docs + +showroom_dnf_packages: + - git + - podman + +showroom_pip_packages: + - podman-compose + +showroom_npm_packages: + - antora + - "@antora/site-generator@3.1" + +showroom_work_dirs: + - "{{ showroom_home_dir }}/content" # The showroom repo itself, asciidoc source e.g. Antora + - "{{ showroom_home_dir }}/orchestration" # compose, kube files etc diff --git a/ansible/roles/nookbag/meta/main.yml b/ansible/roles/nookbag/meta/main.yml new file mode 100644 index 00000000000..edb762d66c0 --- /dev/null +++ b/ansible/roles/nookbag/meta/main.yml @@ -0,0 +1,53 @@ +--- +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/ansible/roles/nookbag/tasks/10-showroom-user-setup.yml b/ansible/roles/nookbag/tasks/10-showroom-user-setup.yml new file mode 100644 index 00000000000..618efaf7c78 --- /dev/null +++ b/ansible/roles/nookbag/tasks/10-showroom-user-setup.yml @@ -0,0 +1,31 @@ +--- + +# +# Create the showroom user and working directories +# + +- name: "Create showroom user {{ showroom_user }}" + ansible.builtin.user: + name: "{{ showroom_user | default('showroom') }}" + home: "{{ showroom_home_dir }}" + +- name: Setup persistent working directory + ansible.builtin.file: + path: "{{ __showroom_work_dir }}" + state: directory + owner: "{{ showroom_user | default('showroom') }}" + group: "{{ showroom_group | default('showroom') }}" + loop: "{{ showroom_work_dirs }}" + loop_control: + loop_var: __showroom_work_dir + +- name: Add passwordless sudo for {{ showroom_user }} + ansible.builtin.lineinfile: + path: /etc/sudoers + regexp: "^{{ showroom_user }}" + line: "{{ showroom_user }} ALL=(ALL) NOPASSWD: ALL" + +# +# TODO: (post PoC) +# ssh configuration for showroom_user +# diff --git a/ansible/roles/nookbag/tasks/20-showroom-dependencies.yml b/ansible/roles/nookbag/tasks/20-showroom-dependencies.yml new file mode 100644 index 00000000000..6daf13fe8e2 --- /dev/null +++ b/ansible/roles/nookbag/tasks/20-showroom-dependencies.yml @@ -0,0 +1,33 @@ +--- +- name: Ensure Linux Package depedencies + ansible.builtin.dnf: + name: "{{ __showroom_dnf_packages }}" + state: present + loop: "{{ showroom_dnf_packages }}" + loop_control: + loop_var: __showroom_dnf_packages + +- name: Ensure Linux Python depedencies + ansible.builtin.pip: + name: "{{ __showroom_pip_packages }}" + state: present + loop: "{{ showroom_pip_packages }}" + loop_control: + loop_var: __showroom_pip_packages + + # + # TODO: Probably remove the npm code + # far better to do this via an antora image than locally installed npm + # however useful during debug for showroom developers + +- name: Install antora + when: showroom_debug | default(false) | bool + community.general.npm: + name: "{{ __showroom_npm_packages }}" + global: true + state: present + loop: "{{ showroom_npm_packages }}" + loop_control: + loop_var: __showroom_npm_packages + tags: + - showroom-npm diff --git a/ansible/roles/nookbag/tasks/30-showroom-clone-and-inject.yml b/ansible/roles/nookbag/tasks/30-showroom-clone-and-inject.yml new file mode 100644 index 00000000000..a3bc904fb85 --- /dev/null +++ b/ansible/roles/nookbag/tasks/30-showroom-clone-and-inject.yml @@ -0,0 +1,36 @@ +--- +- name: Clone and Inject Showroom Tasks + block: + + - name: Clone showroom primary repo - lab content in adoc + ansible.builtin.git: + repo: "{{ showroom_git_repo }}" + dest: "{{ showroom_home_dir }}/content" + force: true + version: "{{ showroom_git_tag | default('main') }}" + become_user: "{{ showroom_user }}" + + - name: Setup and inject userdata + block: + + - name: Load AgnosticD User Data + ansible.builtin.set_fact: + f_user_data: >- + {{ lookup('file', hostvars.localhost.output_dir ~ '/user-data.yaml', errors='ignore') | from_yaml }} + + - name: Fallback for AgnosticD User Data + when: f_user_data | default({}) | length == 0 + ansible.builtin.set_fact: + f_user_data: [] + + - name: Create KV file + ansible.builtin.template: + src: include_vars.adoc.j2 + dest: "{{ showroom_home_dir }}/content/documentation/modules/ROOT/pages/include_vars.adoc" + owner: "{{ showroom_user }}" + group: "{{ showroom_group }}" + mode: '0644' + tags: + - showroom-var-injection + tags: + - showroom-clone-and-inject diff --git a/ansible/roles/nookbag/tasks/40-showroom-render.yml b/ansible/roles/nookbag/tasks/40-showroom-render.yml new file mode 100644 index 00000000000..75aa8a80734 --- /dev/null +++ b/ansible/roles/nookbag/tasks/40-showroom-render.yml @@ -0,0 +1,40 @@ +--- + +- name: Render asciidoc via antora container + containers.podman.podman_container: + name: container + image: docker.io/antora/antora + command: site.yml + volumes: + - "{{ showroom_home_dir }}/content:/antora:Z" + become_user: "{{ showroom_user }}" + register: r_podman_run_antora + tags: + - showroom-render + +- name: Debug Render asciidoc via antora container + ansible.builtin.debug: + var: "{{ r_podman_run_antora }}" + verbosity: 2 + + # TODO: Insert index.html and css injection + # clunky and hardcoded for now, make dynamic + +- name: Insert nookbag + ansible.builtin.unarchive: + src: "{{ showroom_nookbag }}" + dest: "{{ showroom_home_dir }}/content" + remote_src: True + owner: "{{ showroom_user }}" + group: "{{ showroom_group }}" + mode: "u=rw,g=r,o=r" + +- name: Insert lab-config.yml file + ansible.builtin.template: + src: lab-config.yml.j2 + dest: "{{ showroom_home_dir }}/content/lab-config.yml" + owner: "{{ showroom_user }}" + group: "{{ showroom_group }}" + mode: "u=rw,g=r,o=r" + tags: + - showroom-config-file diff --git a/ansible/roles/nookbag/tasks/50-showroom-service.yml b/ansible/roles/nookbag/tasks/50-showroom-service.yml new file mode 100644 index 00000000000..acf94503159 --- /dev/null +++ b/ansible/roles/nookbag/tasks/50-showroom-service.yml @@ -0,0 +1,29 @@ +--- +# +# Orchestrate showroom containers +# + +- name: Insert showroom orchestration files, compose and systemd + ansible.builtin.template: + src: "{{ __orchestration.src }}" + dest: "{{ __orchestration.dest }}" + owner: "{{ __orchestration.owner | default(showroom_user) }}" + group: "{{ __orchestration.group | default(showroom_group) }}" + mode: "u=rw,g=r,o=r" + loop: + - src: "{{ showroom_container_compose_template | default('container-compose.yml.j2') }}" + dest: "{{ showroom_home_dir }}/orchestration/container-compose.yml" + - src: nginx.conf.j2 + dest: "{{ showroom_home_dir }}/orchestration/nginx.conf" + - src: "{{ showroom_systemd_service_template | default('showroom.service.j2') }}" + dest: "/etc/systemd/system/showroom.service" + owner: root + group: root + loop_control: + loop_var: __orchestration + +- name: Enable and Start showroom service + ansible.builtin.service: + name: showroom.service + enabled: true + state: started diff --git a/ansible/roles/nookbag/tasks/60-showroom-verify.yml b/ansible/roles/nookbag/tasks/60-showroom-verify.yml new file mode 100644 index 00000000000..5f74412f92d --- /dev/null +++ b/ansible/roles/nookbag/tasks/60-showroom-verify.yml @@ -0,0 +1,15 @@ +--- +# +# TODO: Basic verification of the showroom service +# - does it run +# - all of it? + +- name: Output showroom view(s) URLs as userinfo and userdata + agnosticd_user_info: + msg: >- + showroom_primary_view_url: http://{{ groups['bastions'][0] | + regex_replace('\\..*$') }}.{{ guid }}{{ subdomain_base_suffix }}:8000 + data: + showroom_primary_view_url: >- + http://{{ groups['bastions'][0] | + regex_replace('\\..*$') }}.{{ guid }}{{ subdomain_base_suffix }}:8000 diff --git a/ansible/roles/nookbag/tasks/main.yml b/ansible/roles/nookbag/tasks/main.yml new file mode 100644 index 00000000000..c2394afd451 --- /dev/null +++ b/ansible/roles/nookbag/tasks/main.yml @@ -0,0 +1,33 @@ +--- + +# +# This is a PoC and includes some/many steps that would be migrated to init containers etc +# + +- name: Setup the showroom user and working directories + ansible.builtin.include_tasks: + file: 10-showroom-user-setup.yml + +- name: Setup OS dependencies, packages, user, directory + ansible.builtin.include_tasks: + file: 20-showroom-dependencies.yml + +- name: Clone primary showroom repo and inject externals (vars, html templates) + ansible.builtin.include_tasks: + file: 30-showroom-clone-and-inject.yml + tags: + - showroom-clone-and-inject + +- name: Render showroom to html if required + ansible.builtin.include_tasks: + file: 40-showroom-render.yml + tags: + - showroom-render + +- name: Create, enable, start showroom systemd service + ansible.builtin.include_tasks: + file: 50-showroom-service.yml + +- name: Validate showroom service and output view url(s) + ansible.builtin.include_tasks: + file: 60-showroom-verify.yml diff --git a/ansible/roles/nookbag/templates/container-compose.yml.j2 b/ansible/roles/nookbag/templates/container-compose.yml.j2 new file mode 100644 index 00000000000..96a20dd7668 --- /dev/null +++ b/ansible/roles/nookbag/templates/container-compose.yml.j2 @@ -0,0 +1,63 @@ +--- +version: "3" + +services: + + web: + image: docker.io/nginx + container_name: web + hostname: web + command: nginx -g "daemon off;" + ports: + - "8000:80" + volumes: + - "{{ showroom_home_dir }}/content:/usr/share/nginx/html:Z" + + # - "{{ showroom_home_dir }}/content:/opt/app-root/src" # :Z + # - ./nginx/nginx.conf:/etc/nginx/nginx.conf + + terminal-01: + image: docker.io/wettyoss/wetty + container_name: terminal-01 + hostname: terminal-01 + command: + - "--ssh-user={{ f_user_data.ssh_username }}" + - "--ssh-pass={{ f_user_data.ssh_password }}" + - "--ssh-host={{ f_user_data.targethost }}" + - --allow-iframe=true + ports: + - "8001:3000" + + terminal-02: + image: docker.io/wettyoss/wetty + container_name: terminal-02 + hostname: terminal-02 + command: + - "--ssh-user={{ f_user_data.ssh_username }}" + - "--ssh-pass={{ f_user_data.ssh_password }}" + - "--ssh-host={{ f_user_data.targethost }}" + - --allow-iframe=true + ports: + - "8002:3000" + + codeserver: + image: docker.io/codercom/code-server + container_name: codeserver + hostname: codeserver + environment: + - PASSWORD={{ common_password }} + ports: + - "8003:8080" + + # old style - env var better e.g. PASSWORD + # volumes: + # - "./config/code-server:/home/coder/.config/code-server" + + # RHDP codeserver + # + # image: quay.io/gpte-devops-automation/codeserver #docker.io/codercom/code-server + # platform: linux/amd64 + + # volumes: + # - ".:/home/coder" + # -u "$(id -u):$(id -g)" \ diff --git a/ansible/roles/nookbag/templates/include_vars.adoc.j2 b/ansible/roles/nookbag/templates/include_vars.adoc.j2 new file mode 100644 index 00000000000..84a424dd80e --- /dev/null +++ b/ansible/roles/nookbag/templates/include_vars.adoc.j2 @@ -0,0 +1,3 @@ +{% for k,v in f_user_data.items() %} +:{{k}}: {{v}} +{% endfor %} diff --git a/ansible/roles/nookbag/templates/lab-config.yml.j2 b/ansible/roles/nookbag/templates/lab-config.yml.j2 new file mode 100644 index 00000000000..60b8896b570 --- /dev/null +++ b/ansible/roles/nookbag/templates/lab-config.yml.j2 @@ -0,0 +1,4 @@ +showroom_version: {{ showroom_version }} +showroom_name: {{ showroom_name }} +showroom_modules: {{ showroom_modules }} +showroom_services: {{ showroom_services }} \ No newline at end of file diff --git a/ansible/roles/nookbag/templates/main_compose_template.j2 b/ansible/roles/nookbag/templates/main_compose_template.j2 new file mode 100644 index 00000000000..c1d6af42dc2 --- /dev/null +++ b/ansible/roles/nookbag/templates/main_compose_template.j2 @@ -0,0 +1,27 @@ +--- +# Automatically generated Showroom Compose Orchestration file +# via AgnosticD showroom role +# https://github.com/redhat-cop/agnosticd/tree/development/ansible/roles/showroom + +version: "3" + +services: + + web: + image: docker.io/nginx + container_name: web + hostname: web + command: nginx -g "daemon off;" + ports: + - "8000:80" + volumes: + - "{{ showroom_home_dir }}/content:/usr/share/nginx/html:Z" + +{% for service in showroom_tab_services %} +{% macro fake_indent_op() %} +{% include 'service_' + service + '/service_' + service + '.j2' ignore missing %} +{% endmacro %} + {{ fake_indent_op() | indent(2) }} + +{% endfor %} +... diff --git a/ansible/roles/nookbag/templates/nginx.conf.j2 b/ansible/roles/nookbag/templates/nginx.conf.j2 new file mode 100644 index 00000000000..2b6bc87e70d --- /dev/null +++ b/ansible/roles/nookbag/templates/nginx.conf.j2 @@ -0,0 +1,86 @@ +# For more information on configuration, see: +# * Official English Documentation: http://nginx.org/en/docs/ +# * Official Russian Documentation: http://nginx.org/ru/docs/ + + +worker_processes auto; +error_log /var/log/nginx/error.log notice; +pid /run/nginx.pid; + +# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. +include /usr/share/nginx/modules/*.conf; + +events { + worker_connections 1024; +} + +http { + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + keepalive_timeout 65; + types_hash_max_size 4096; + + include /etc/nginx/mime.types; + default_type application/octet-stream; + + # Load modular configuration files from the /etc/nginx/conf.d directory. + # See http://nginx.org/en/docs/ngx_core_module.html#include + # for more information. + include /opt/app-root/etc/nginx.d/*.conf; + + server { + listen 8080 default_server; + listen [::]:8080 default_server; + server_name _; + root /opt/app-root/src; + + # Load configuration files for the default server block. + include /opt/app-root/etc/nginx.default.d/*.conf; + + location = /404.html { + } + + # location /codeserver { + # proxy_pass http://codeserver:8088; + # } + # + # location /tty { + # proxy_pass http://localhost:8001; + # } + # + # location /docs { + # proxy_pass https://docs.ansible.com; + # } + } + +# Settings for a TLS enabled server. +# +# server { +# listen 443 ssl http2; +# listen [::]:443 ssl http2; +# server_name _; +# root /opt/app-root/src; +# +# ssl_certificate "/etc/pki/nginx/server.crt"; +# ssl_certificate_key "/etc/pki/nginx/private/server.key"; +# ssl_session_cache shared:SSL:1m; +# ssl_session_timeout 10m; +# ssl_ciphers PROFILE=SYSTEM; +# ssl_prefer_server_ciphers on; +# +# # Load configuration files for the default server block. +# include /opt/app-root/etc/nginx.default.d/*.conf; +# +# location = /404.html { +# } +# +# } + +} + diff --git a/ansible/roles/nookbag/templates/service_codeserver/service_codeserver.j2 b/ansible/roles/nookbag/templates/service_codeserver/service_codeserver.j2 new file mode 100644 index 00000000000..3c3a72e8e4f --- /dev/null +++ b/ansible/roles/nookbag/templates/service_codeserver/service_codeserver.j2 @@ -0,0 +1,8 @@ +codeserver: + image: docker.io/codercom/code-server + container_name: codeserver + hostname: codeserver + environment: + - PASSWORD={{ common_password }} + ports: + - "8003:8080" diff --git a/ansible/roles/nookbag/templates/service_codeserver/tab_codeserver.j2 b/ansible/roles/nookbag/templates/service_codeserver/tab_codeserver.j2 new file mode 100644 index 00000000000..5f3d148b2b9 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_codeserver/tab_codeserver.j2 @@ -0,0 +1,3 @@ +
+ +
diff --git a/ansible/roles/nookbag/templates/service_codeserver/tablink_codeserver.j2 b/ansible/roles/nookbag/templates/service_codeserver/tablink_codeserver.j2 new file mode 100644 index 00000000000..8f277c450c7 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_codeserver/tablink_codeserver.j2 @@ -0,0 +1 @@ + diff --git a/ansible/roles/nookbag/templates/service_docs/tab_docs.j2 b/ansible/roles/nookbag/templates/service_docs/tab_docs.j2 new file mode 100644 index 00000000000..cf22633e573 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_docs/tab_docs.j2 @@ -0,0 +1,3 @@ +
+ +
diff --git a/ansible/roles/nookbag/templates/service_docs/tablink_docs.j2 b/ansible/roles/nookbag/templates/service_docs/tablink_docs.j2 new file mode 100644 index 00000000000..ece56779276 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_docs/tablink_docs.j2 @@ -0,0 +1 @@ + diff --git a/ansible/roles/nookbag/templates/service_double_terminal/service_double_terminal.j2 b/ansible/roles/nookbag/templates/service_double_terminal/service_double_terminal.j2 new file mode 100644 index 00000000000..bd78bd7d555 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_double_terminal/service_double_terminal.j2 @@ -0,0 +1,23 @@ +terminal-01: + image: docker.io/wettyoss/wetty + container_name: terminal-01 + hostname: terminal-01 + command: + - "--ssh-user={{ f_user_data.ssh_username }}" + - "--ssh-pass={{ f_user_data.ssh_password }}" + - "--ssh-host={{ f_user_data.targethost }}" + - --allow-iframe=true + ports: + - "8001:3000" + +terminal-02: + image: docker.io/wettyoss/wetty + container_name: terminal-02 + hostname: terminal-02 + command: + - "--ssh-user={{ f_user_data.ssh_username }}" + - "--ssh-pass={{ f_user_data.ssh_password }}" + - "--ssh-host={{ f_user_data.targethost }}" + - --allow-iframe=true + ports: + - "8002:3000" diff --git a/ansible/roles/nookbag/templates/service_double_terminal/tab_double_terminal.j2 b/ansible/roles/nookbag/templates/service_double_terminal/tab_double_terminal.j2 new file mode 100644 index 00000000000..90bcf5aa006 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_double_terminal/tab_double_terminal.j2 @@ -0,0 +1,8 @@ +
+
+ +
+
+ +
+
diff --git a/ansible/roles/nookbag/templates/service_double_terminal/tablink_double_terminal.j2 b/ansible/roles/nookbag/templates/service_double_terminal/tablink_double_terminal.j2 new file mode 100644 index 00000000000..92778bf19ea --- /dev/null +++ b/ansible/roles/nookbag/templates/service_double_terminal/tablink_double_terminal.j2 @@ -0,0 +1 @@ + diff --git a/ansible/roles/nookbag/templates/service_double_terminal/tabs_double_terminal.j2 b/ansible/roles/nookbag/templates/service_double_terminal/tabs_double_terminal.j2 new file mode 100644 index 00000000000..609eb4d3d7f --- /dev/null +++ b/ansible/roles/nookbag/templates/service_double_terminal/tabs_double_terminal.j2 @@ -0,0 +1,76 @@ + + + + + + + + +
+
+ +
+
+
+ + + + +
+
+
+ +
+
+ +
+
+
+ +
+
+ +
+
+
+ + + + + + + diff --git a/ansible/roles/nookbag/templates/service_single_terminal/service_single_terminal.j2 b/ansible/roles/nookbag/templates/service_single_terminal/service_single_terminal.j2 new file mode 100644 index 00000000000..d58360e771d --- /dev/null +++ b/ansible/roles/nookbag/templates/service_single_terminal/service_single_terminal.j2 @@ -0,0 +1,11 @@ +terminal-01: + image: docker.io/wettyoss/wetty + container_name: terminal-01 + hostname: terminal-01 + command: + - "--ssh-user={{ f_user_data.ssh_username }}" + - "--ssh-pass={{ f_user_data.ssh_password }}" + - "--ssh-host={{ f_user_data.targethost }}" + - --allow-iframe=true + ports: + - "8001:3000" diff --git a/ansible/roles/nookbag/templates/service_single_terminal/tab_single_terminal.j2 b/ansible/roles/nookbag/templates/service_single_terminal/tab_single_terminal.j2 new file mode 100644 index 00000000000..64875721ad3 --- /dev/null +++ b/ansible/roles/nookbag/templates/service_single_terminal/tab_single_terminal.j2 @@ -0,0 +1,3 @@ +
+ +
diff --git a/ansible/roles/nookbag/templates/service_single_terminal/tablink_single_terminal.j2 b/ansible/roles/nookbag/templates/service_single_terminal/tablink_single_terminal.j2 new file mode 100644 index 00000000000..92778bf19ea --- /dev/null +++ b/ansible/roles/nookbag/templates/service_single_terminal/tablink_single_terminal.j2 @@ -0,0 +1 @@ + diff --git a/ansible/roles/nookbag/templates/showroom.service.j2 b/ansible/roles/nookbag/templates/showroom.service.j2 new file mode 100644 index 00000000000..53d8887fcd4 --- /dev/null +++ b/ansible/roles/nookbag/templates/showroom.service.j2 @@ -0,0 +1,18 @@ +[Unit] +Description=Showroom Service +Documentation=man:podman-generate-systemd(1) +Wants=network.target +After=network-online.target + +[Service] +User={{ showroom_user | default('showroom') }} +Group={{ showroom_group | default('showroom') }} +Environment=PODMAN_SYSTEMD_UNIT=%n +Restart=on-failure +ExecStart=/usr/local/bin/podman-compose -f {{ showroom_home_dir }}/orchestration/container-compose.yml up -d +ExecStop=/usr/local/bin/podman-compose -f {{ showroom_home_dir }}/orchestration/container-compose.yml down +KillMode=none +Type=forking + +[Install] +WantedBy=multi-user.target default.target