Skip to content

Commit

Permalink
Add experience for Windows IIS
Browse files Browse the repository at this point in the history
This experience is for deploying Windows IIS Server.

Include the execution environment to run against and how to build it
manually for now.
  • Loading branch information
p3ck committed Nov 21, 2024
1 parent 67a66d0 commit 8bd1c99
Show file tree
Hide file tree
Showing 14 changed files with 236 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/experiences/create_iis/exec_env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
context/**
8 changes: 8 additions & 0 deletions extensions/experiences/create_iis/exec_env/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Build EE manually, push to quay.io

```
ansible-builder build
# podman build -f context/Containerfile -t ansible-execution-env:latest context
podman tag ansible-execution-env:latest quay.io/p3ck/apd-ee-25-experience:latest
podman push quay.io/p3ck/apd-ee-25-experience:latest
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: 3
images:
base_image:
name: quay.io/ansible-product-demos/apd-ee-25:latest
dependencies:
galaxy: requirements.yml
ansible_core:
package_pip: ansible-core
ansible_runner:
package_pip: ansible-runner
system:
- podman
6 changes: 6 additions & 0 deletions extensions/experiences/create_iis/exec_env/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
# - name: ansible.experience_demo
- name: https://github.com/p3ck/infra.windows_ops.git
type: git
version: feature-service-aae
22 changes: 22 additions & 0 deletions extensions/experiences/create_iis/playbooks/run_create_iis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
- name: Create IIS Server Play
hosts: all
gather_facts: false
tasks:
- name: Create default test message if not provided
ansible.builtin.set_fact:
test_message: "Welcome to IIS Web Server"
when: iis_test_message is not defined

- name: Set Default vars
ansible.builtin.set_fact:
test_message_final: "{{ iis_test_message | default(test_message) }}"

- name: Create IIS Server
ansible.builtin.include_role:
name: infra.windows_ops.windows_manage_iis
vars:
windows_manage_iis_name: "{{ iis_name }}" # Set by survey
windows_manage_iis_path: "{{ iis_path }}" # Set by survey
windows_manage_iis_port: "{{ iis_port }}" # Set by survey
windows_manage_iis_test_message: "{{ test_message_final }}" # Use conditional message
49 changes: 49 additions & 0 deletions extensions/experiences/create_iis/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# Labels
#
controller_labels:
- name: infra.windows_ops
organization: "{{ organization | default('Default') }}"
- name: create_iis
organization: "{{ organization | default('Default') }}"
- name: run_create_iis
organization: "{{ organization | default('Default') }}"

# Execution Environments
#
controller_execution_environments:
# - name: apd-ee-25
# description: apd-ee-25
# image: quay.io/ansible-product-demos/apd-ee-25
# pull: always
- name: apd-ee-25-rhel
description: Allow running RHEL experience demo. Based on apd-ee-25.
image: quay.io/p3ck/apd-ee-25-experience:latest
pull: always

# Projects
#
controller_projects:
- name: Windows Operations / Project
organization: Default
scm_branch: main
scm_clean: 'no'
scm_delete_on_update: 'no'
scm_type: git
scm_update_on_launch: 'no'
scm_url: https://github.com/redhat-cop/infra.windows_ops.git


# Job Templates
#
controller_templates:
- name: Windows Operations / Create IIS
ask_inventory_on_launch: true
labels:
- infra.windows_ops
- create_iis
- run_create_iis
playbook: extensions/experiences/create_iis/playbooks/run_create_iis.yml
project: Windows Ops PLaybooks Project
survey_enabled: true
survey_spec: "{{ lookup('file', experience.path.replace('setup.yml', '') + 'template_surveys/create_iis.yaml') | from_yaml }}"
29 changes: 29 additions & 0 deletions extensions/experiences/create_iis/template_surveys/create_iis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: "Create IIS Configuration Survey"
description: "Survey to configure create IIS options"
spec:
- type: "text"
question_name: "Server Name"
question_description: "Name of the IIS Web Server"
variable: "iis_name"
required: true

- type: "text"
question_name: "Server Path"
question_description: "Path to the root directory of the IIS Web Server"
variable: "iis_path"
required: true

- type: "integer"
question_name: "Server Port"
question_description: "Network port to listen on"
variable: "iis_port"
required: true
default: "80"

- type: "text"
question_name: "Test Message"
question_description: "Test Message to place in index.html"
variable: "iis_test_message"
required: false
default: "Welcome to IIS Web Server"
1 change: 1 addition & 0 deletions extensions/experiences/delete_iis/exec_env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
context/**
8 changes: 8 additions & 0 deletions extensions/experiences/delete_iis/exec_env/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Build EE manually, push to quay.io

```
ansible-builder build
# podman build -f context/Containerfile -t ansible-execution-env:latest context
podman tag ansible-execution-env:latest quay.io/p3ck/apd-ee-25-experience:latest
podman push quay.io/p3ck/apd-ee-25-experience:latest
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
version: 3
images:
base_image:
name: quay.io/ansible-product-demos/apd-ee-25:latest
dependencies:
galaxy: requirements.yml
ansible_core:
package_pip: ansible-core
ansible_runner:
package_pip: ansible-runner
system:
- podman
6 changes: 6 additions & 0 deletions extensions/experiences/delete_iis/exec_env/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
# - name: ansible.experience_demo
- name: https://github.com/p3ck/infra.windows_ops.git
type: git
version: feature-service-aae
12 changes: 12 additions & 0 deletions extensions/experiences/delete_iis/playbooks/run_delete_iis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Delete IIS Server Play
hosts: all
gather_facts: false
tasks:
- name: Delete IIS Server
ansible.builtin.include_role:
name: infra.windows_ops.windows_manage_iis
vars:
windows_manage_iis_name: "{{ iis_name }}" # Set by survey
windows_manage_iis_delete_option: "{{ iis_remove_all }}" # Set by survey
windows_manage_iis_operation: "delete"
49 changes: 49 additions & 0 deletions extensions/experiences/delete_iis/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
# Labels
#
controller_labels:
- name: infra.windows_ops
organization: "{{ organization | default('Default') }}"
- name: delete_iis
organization: "{{ organization | default('Default') }}"
- name: run_delete_iis
organization: "{{ organization | default('Default') }}"

# Execution Environments
#
controller_execution_environments:
# - name: apd-ee-25
# description: apd-ee-25
# image: quay.io/ansible-product-demos/apd-ee-25
# pull: always
- name: apd-ee-25-rhel
description: Allow running RHEL experience demo. Based on apd-ee-25.
image: quay.io/p3ck/apd-ee-25-experience:latest
pull: always

# Projects
#
controller_projects:
- name: Windows Operations / Project
organization: Default
scm_branch: main
scm_clean: 'no'
scm_delete_on_update: 'no'
scm_type: git
scm_update_on_launch: 'no'
scm_url: https://github.com/redhat-cop/infra.windows_ops.git


# Job Templates
#
controller_templates:
- name: Windows Operations / Delete IIS
ask_inventory_on_launch: true
labels:
- infra.windows_ops
- delete_iis
- run_delete_iis
playbook: extensions/experiences/create_iis/playbooks/run_delete_iis.yml
project: Windows Ops PLaybooks Project
survey_enabled: true
survey_spec: "{{ lookup('file', experience.path.replace('setup.yml', '') + 'template_surveys/delete_iis.yaml') | from_yaml }}"
19 changes: 19 additions & 0 deletions extensions/experiences/delete_iis/template_surveys/delete_iis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: "Delete IIS Configuration Survey"
description: "Survey to configure delete IIS options"
spec:
- type: "text"
question_name: "Server Name"
question_description: "Name of the IIS Web Server"
variable: "iis_name"
required: true

- type: "multiplechoice"
question_name: "Remove Feature IIS"
question_description: "Select all to remove the IIS Service as well as the Web Server definition"
choices:
- "all"
- "server"
variable: "iis_remove_all"
default: "server"
required: false

0 comments on commit 8bd1c99

Please sign in to comment.