Skip to content

Commit

Permalink
Merge pull request #470 from ansible/devel
Browse files Browse the repository at this point in the history
Release PR August 1st, 2023
  • Loading branch information
IPvSean authored Aug 1, 2023
2 parents f4f8900 + b868107 commit 62b91f1
Show file tree
Hide file tree
Showing 191 changed files with 5,901 additions and 126 deletions.
27 changes: 20 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/ubuntu/.devcontainer/base.Dockerfile
# https://hub.docker.com/_/fedora
FROM fedora:37

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# update and install OS packages
RUN dnf -y update && dnf -y install \
python3-pip \
python3-devel \
wget \
vim \
unzip \
curl \
git

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# install requirements
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

# configure user and sudo
RUN useradd vscode
RUN sudo sed -e 's/^%wheel/#%wheel/g' -e 's/^# %wheel/%wheel/g' \
-i /etc/sudoers && \
usermod -aG wheel vscode

# instruqt cli install
RUN curl -L https://github.com/instruqt/cli/releases/download/2038-91f9762/instruqt-linux-2038-91f9762.zip -o /tmp/instruqt.zip
RUN unzip /tmp/instruqt.zip
# RUN /tmp/instruqt update
Expand Down
11 changes: 4 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.233.0/containers/ubuntu
{
"name": "Ubuntu",
"name": "Fedora",
"build": {
"dockerfile": "Dockerfile",
"context" : ".."
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-22.04" }
// "args": { "VARIANT": "ubuntu-22.04" }
},

// Set *default* container specific settings.json values on container create.
Expand All @@ -23,9 +24,5 @@
// "postCreateCommand": "uname -a",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
"features": {
"git": "latest",
"python": "3.10"
}
"remoteUser": "vscode"
}
58 changes: 54 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,64 @@
# ansible/instruqt
# Ansible Self-Paced Workshop Directory
These are 90 minute workshops with multiple self-paced labs in them.

## How to access the labs

* [Community Labs (How to contribute, what's ansible-test, etc)](https://www.ansible.com/products/ansible-community-training)
* [Product & user labs (How to use Automation Controller, Ansible Builder, etc](https://www.redhat.com/en/interactive-labs/ansible)
| Workshop Title | Link |
|---|---|
| Cloud Automation Technical Workshop | [🔬 Open Workshop](./webpages/ansible-cloud-lab.md) |
| Event-Driven Ansible Technical Workshop | [🔬 Open Workshop](./webpages/eda.md) |

# Self-Paced Labs Directory

## Event-Driven Ansible (EDA)

<table>
<thead>
<tr>
<th>Lab Title</th>
<th>Link</th>
</tr>
</thead>
<tbody>
<tr>
<td>Get started with Event-Driven Ansible and Ansible rulebooks</td>
<td><a target="_blank" href="https://play.instruqt.com/redhat/invite/wzlzehptcqi6/tracks/eda--ansible-rulebook">🚀 Launch Lab</a></td>
</tr>
<tr>
<td>Event-Driven Ansible and NetOps</td>
<td><a target="_blank" href="https://play.instruqt.com/embed/redhat/tracks/event-driven-netops?token=em_W0qtY5GifN13CZ1a">🚀 Launch Lab</a></td>
</tr>
<tr>
<td>GitOps with Event-Driven Ansible</td>
<td><a target="_blank" href="https://play.instruqt.com/embed/redhat/tracks/eda-gitops?token=em__C74PAmX2rePq7Kk">🚀 Launch Lab</a></td>
</tr>
</tbody>
</table>

## Network Automation

<table>
<thead>
<tr>
<th>Lab Title</th>
<th>Link</th>
</tr>
</thead>
<tbody>
<tr>
<td>Palo Alto Networks firewall automation with AAP</td>
<td><a target="_blank" href="https://play.instruqt.com/embed/redhat/tracks/ansible-panos-automation?token=em_iiCtxt5JWd5Iube8">🚀 Launch Lab</a></td>
</tr>
</tbody>
</table>

## Feedback and Issues

Please [open issues](https://github.com/ansible/instruqt/issues/new) so we can fix any problems that occur.

## External Lab webpages

* [Community Labs (How to contribute, what's ansible-test, etc)](https://www.ansible.com/products/ansible-community-training)
* [Product & user labs (How to use Automation Controller, Ansible Builder, etc](https://www.redhat.com/en/interactive-labs/ansible)

## Contribute

Expand Down
37 changes: 16 additions & 21 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<html lang="{{ site.lang | default: "en-US" }}">
<head>
<link rel="shortcut icon" type="image/x-icon" href="assets/images/favicon.png">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

Expand Down Expand Up @@ -37,41 +38,35 @@
</a>
{% if page.path == "webpages/ansible-cloud-lab.md" %}
<a class="header-link-active" href="{{ '/webpages/ansible-cloud-lab' | relative_url }}">
cloud automation
cloud automation workshop
</a>
{% else %}
<a class="header-link" href="{{ '/webpages/ansible-cloud-lab' | relative_url }}">
cloud automation
cloud automation workshop
</a>
{% endif %}
{% if page.path == "webpages/eda-gitops-lab.md" %}
<a class="header-link-active" href="{{ '/webpages/eda-gitops-lab' | relative_url }}">
Gitops with EDA
{% if page.path == "webpages/eda.md" %}
<a class="header-link-active" href="{{ '/webpages/eda' | relative_url }}">
Event-Driven Ansible Workshop
</a>
{% else %}
<a class="header-link" href="{{ '/webpages/eda-gitops-lab' | relative_url }}">
Gitops with EDA
<a class="header-link" href="{{ '/webpages/eda' | relative_url }}">
Event-Driven Ansible Workshop
</a>
{% endif %}
{% if page.path == "webpages/ansible-edge-lab.md" %}
<a class="header-link" target="_new" href="https://github.com/ansible/instruqt/issues/new">
Open an Issue
</a>
<!-- {% if page.path == "webpages/ansible-edge-lab.md" %}
<a class="header-link-active" href="{{ '/webpages/ansible-edge-lab' | relative_url }}">
Edge
</a>
{% else %}
<a class="header-link" href="{{ '/webpages/ansible-edge-lab' | relative_url }}">
Edge
</a>
{% endif %}
{% if page.path == "webpages/lightspeed.md" %}
<a class="header-link-active" href="{{ '/webpages/lightspeed' | relative_url }}">
Lightspeed
</a>
{% else %}
<a class="header-link" href="{{ '/webpages/lightspeed' | relative_url }}">
Lightspeed
</a>
{% endif %}
{% if page.path == "webpages/controller.md" %}
{% endif %} -->
<!-- {% if page.path == "webpages/controller.md" %}
<a class="header-link-active" href="{{ '/webpages/controller' | relative_url }}">
Automation controller
</a>
Expand All @@ -97,7 +92,7 @@
<a class="header-link" href="{{ '/webpages/servicenow' | relative_url }}">
ServiceNow
</a>
{% endif %}
{% endif %} -->
</div>
</header>

Expand All @@ -115,7 +110,7 @@
alt="Red Hat"
/>
</a>
<p class="footer-copyright">Copyright © 2022 Red Hat, Inc.</p>
<p class="footer-copyright">Copyright © 2023 Red Hat, Inc.</p>
<div class="footer-linkContainer">
<a href="https://www.redhat.com/en/about/privacy-policy" class="footer-link">Privacy statement</a>
<span class="footer-linkSpacer">|</span>
Expand Down
4 changes: 4 additions & 0 deletions assets/css/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,7 @@ a h3 {
a h3:hover {
color: #5F0000;
}

b {
font-weight: bolder;
}
Binary file added assets/images/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions images/ansible/controller-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

- name: download aap
vars:
provided_sha_value: 7456b98f2f50e0e1d4c93fb4e375fe8a9174f397a5b1c0950915224f7f020ec4
provided_sha_value: 95f5bfc00f65be7785098bf196f21e76c3eca54f95b203ba8655c80676f665a7
include_role:
name: ansible.workshops.aap_download

Expand All @@ -34,7 +34,7 @@
- "{{ ee_registry_name }}/ansible-automation-platform-23/ee-supported-rhel8:latest"
- "{{ ee_registry_name }}/ansible-automation-platform-23/ee-minimal-rhel8:latest"
ee_default_image: "{{ ee_registry_name }}/ansible-automation-platform-23/ee-supported-rhel8:latest"

pre_build: false
tasks:
- name: install automation controller
vars:
Expand Down Expand Up @@ -85,10 +85,10 @@
ansible.builtin.include_tasks:
file: "{{ playbook_dir }}/common/10_image_cleanup.yml"

- name: copy setup-scripts to control node
ansible.builtin.copy:
src: ./setup-scripts
dest: /tmp
# - name: copy setup-scripts to control node
# ansible.builtin.copy:
# src: ./setup-scripts
# dest: /tmp

- name: Playbook to configure ansible controller post installation
hosts: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
when: ansible_distribution == 'RedHat'

# TASK 6
# # 6a. Uncomment Task 7 description and generate an Ansible Playbook task suggestion.
# # 6a. Uncomment Task 6 description and generate an Ansible Playbook task suggestion.
# # 6b. Note how Ansible Lightspeed learnt as you created the Playbook
# # and added "when: ansible_distribution == 'RedHat'" to the task.
# # 6c. Save.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# # "- name: Print sestatus_result.stdout_lines var".
# # 3e. Generate a new task suggestion.

# - name: Print sestatus_result.stdout_lines var
# - name: Print msg

# TASK 4
# # 4a. Uncomment Task 4 description and generate a task suggestion.
Expand All @@ -41,7 +41,7 @@
# - name: Disable password auth on RHEL hosts

# TASK 6
# # 6a. Uncomment Task 7 description and generate an Ansible Playbook task suggestion.
# # 6a. Uncomment Task 6 description and generate an Ansible Playbook task suggestion.
# # 6b. Note how Ansible Lightspeed learnt as you created the Playbook
# # and added "when: ansible_distribution == 'RedHat'" to the task.
# # 6c. Save.
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
ansible-core
ansible-navigator
ansible-lint
yamllint
ansible-core==2.14.1
ansible-navigator==2.2.0
ansible-lint==6.11.0
3 changes: 3 additions & 0 deletions solutions/writing-first-playbook/01-playbook-inventory/hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[web]
node1
node2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: Apache server installed
hosts: node1
become: true
tasks:
- name: latest Apache version installed
ansible.builtin.package:
name: httpd
state: latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

#Verify httpd is installed
ansible node1 /home/rhel/ansible-files/hosts -m ansible.builtin.shell -a "rpm -q httpd"

14 changes: 14 additions & 0 deletions solutions/writing-first-playbook/04-playbook-extend/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: Apache server installed
hosts: node1
become: true
tasks:
- name: latest Apache version installed
ansible.builtin.package:
name: httpd
state: latest
- name: Apache enabled and running
ansible.builtin.service:
name: httpd
enabled: true
state: started
18 changes: 18 additions & 0 deletions solutions/writing-first-playbook/05-playbook-files/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Apache server installed
hosts: node1
become: true
tasks:
- name: latest Apache version installed
ansible.builtin.package:
name: httpd
state: latest
- name: Apache enabled and running
ansible.builtin.service:
name: httpd
enabled: true
state: started
- name: copy web.html
ansible.builtin.copy:
src: web.html
dest: /var/www/html/index.html
3 changes: 3 additions & 0 deletions solutions/writing-first-playbook/05-playbook-files/web.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
<h1>Apache is running fine, thanks to Ansible!</h1>
</body>
18 changes: 18 additions & 0 deletions solutions/writing-first-playbook/06-playbook-multi-node/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Apache server installed
hosts: web
become: true
tasks:
- name: latest Apache version installed
ansible.builtin.package:
name: httpd
state: latest
- name: Apache enabled and running
ansible.builtin.service:
name: httpd
enabled: true
state: started
- name: copy web.html
ansible.builtin.copy:
src: web.html
dest: /var/www/html/index.html
18 changes: 18 additions & 0 deletions solutions/writing-first-playbook/07-playbook-variables/apache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: Apache server installed
hosts: web
become: true
tasks:
- name: latest Apache version installed
ansible.builtin.package:
name: httpd
state: latest
- name: Apache enabled and running
ansible.builtin.service:
name: httpd
enabled: true
state: started
- name: copy web.html
ansible.builtin.copy:
src: "{{ stage }}_web.html"
dest: /var/www/html/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
<h1>This is a development webserver, have fun!</h1>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
stage: prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<body>
<h1>This is a production webserver, take care!</h1>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
stage: dev
Loading

0 comments on commit 62b91f1

Please sign in to comment.