From 49eab64f0c65dba03e40b7dd1ebd36a85517058d Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Mon, 14 Oct 2024 10:36:03 +0200 Subject: [PATCH 1/4] fix pipeline for slides --- .github/workflows/build-slides.yaml | 12 ++++++------ slides/Dockerfile | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-slides.yaml b/.github/workflows/build-slides.yaml index 3d99b499..ca9d512c 100644 --- a/.github/workflows/build-slides.yaml +++ b/.github/workflows/build-slides.yaml @@ -9,7 +9,7 @@ jobs: build-slides-stg: runs-on: ubuntu-latest steps: - - + - name: Checkout uses: actions/checkout@v3 with: @@ -22,13 +22,13 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to Quay.io Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAYIO_USERNAME }} password: ${{ secrets.QUAYIO_TOKEN }} - - - name: Build Slides + - + name: Build Slides uses: docker/build-push-action@v3 with: context: . @@ -55,12 +55,12 @@ jobs: with: name: trivy-results-build path: trivy-results.txt - - + - name: Install Kubectl uses: azure/setup-kubectl@v3 with: version: v1.21.2 - - + - name: Deploy RevealJS Stg env: TRAINING_NAMESPACE: 'pitc-ansible-training-stg' diff --git a/slides/Dockerfile b/slides/Dockerfile index 8f0b10de..5712927d 100644 --- a/slides/Dockerfile +++ b/slides/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /app RUN --mount=type=secret,id=gitlab_pullsecret PULLSECRET=$(cat /run/secrets/gitlab_pullsecret) \ && git clone https://github.com/hakimel/reveal.js.git reveal \ - && git clone https://:${PULLSECRET}@gitlab.puzzle.ch/pitc_members/pitc-revealjs-theme.git puzzle-theme \ + && git clone https://github.com/puzzle/pitc-revealjs-theme.git puzzle-theme \ && mv puzzle-theme/css/theme/puzzle.css reveal/css/theme/ \ && mv puzzle-theme/css/theme/source/puzzle.scss reveal/css/theme/source/ \ && mv puzzle-theme/css/theme/source/puzzle-imgs reveal/css/theme/source/ \ @@ -23,6 +23,6 @@ RUN patch --forward --strip=1 index.html --input=index.html.patch \ RUN chgrp -R 0 ${NPM_CONFIG_CACHE} \ && chmod -R g=u ${NPM_CONFIG_CACHE} - + EXPOSE 8000 CMD ["npm", "start", "--", "--host=0.0.0.0"] From 00764169706fe61150b1dd8edff03c2bca94aba0 Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Mon, 14 Oct 2024 10:40:48 +0200 Subject: [PATCH 2/4] remove pullsecret that is not needed anymore --- slides/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/slides/Dockerfile b/slides/Dockerfile index 5712927d..e6222123 100644 --- a/slides/Dockerfile +++ b/slides/Dockerfile @@ -4,8 +4,7 @@ ENV NPM_CONFIG_CACHE=/tmp/.npm WORKDIR /app -RUN --mount=type=secret,id=gitlab_pullsecret PULLSECRET=$(cat /run/secrets/gitlab_pullsecret) \ - && git clone https://github.com/hakimel/reveal.js.git reveal \ +RUN git clone https://github.com/hakimel/reveal.js.git reveal \ && git clone https://github.com/puzzle/pitc-revealjs-theme.git puzzle-theme \ && mv puzzle-theme/css/theme/puzzle.css reveal/css/theme/ \ && mv puzzle-theme/css/theme/source/puzzle.scss reveal/css/theme/source/ \ From 0a61175186c9400b39d30f57073da4b449b20651 Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Thu, 5 Dec 2024 17:09:20 +0100 Subject: [PATCH 3/4] fix reveal --- slides/Dockerfile | 10 ++-------- slides/index.html.patch | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/slides/Dockerfile b/slides/Dockerfile index e6222123..933a95c4 100644 --- a/slides/Dockerfile +++ b/slides/Dockerfile @@ -4,13 +4,7 @@ ENV NPM_CONFIG_CACHE=/tmp/.npm WORKDIR /app -RUN git clone https://github.com/hakimel/reveal.js.git reveal \ - && git clone https://github.com/puzzle/pitc-revealjs-theme.git puzzle-theme \ - && mv puzzle-theme/css/theme/puzzle.css reveal/css/theme/ \ - && mv puzzle-theme/css/theme/source/puzzle.scss reveal/css/theme/source/ \ - && mv puzzle-theme/css/theme/source/puzzle-imgs reveal/css/theme/source/ \ - && rm -rf puzzle-theme \ - && rm -rf reveal/.git/ +RUN git clone https://github.com/hakimel/reveal.js.git reveal WORKDIR reveal @@ -18,7 +12,7 @@ COPY slides/ansible-techlab ./ansible-techlab COPY slides/index.html.patch . RUN patch --forward --strip=1 index.html --input=index.html.patch \ - && npm install && npm run build -- css-themes + && npm install RUN chgrp -R 0 ${NPM_CONFIG_CACHE} \ && chmod -R g=u ${NPM_CONFIG_CACHE} diff --git a/slides/index.html.patch b/slides/index.html.patch index db442f11..b5e2f925 100644 --- a/slides/index.html.patch +++ b/slides/index.html.patch @@ -1,11 +1,11 @@ --- index_orig.html 2021-10-27 21:22:24.221941946 +0200 +++ index.html 2021-10-27 21:07:05.583077961 +0200 @@ -8,17 +8,20 @@ - + - -+ ++ - From 8936548f41268274aa5fbad06149f1e707343ef0 Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Fri, 6 Dec 2024 09:42:15 +0100 Subject: [PATCH 4/4] fix slides --- slides/ansible-techlab/puzzle-demo.md | 43 +++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/slides/ansible-techlab/puzzle-demo.md b/slides/ansible-techlab/puzzle-demo.md index 7e2fead0..8320cc0c 100644 --- a/slides/ansible-techlab/puzzle-demo.md +++ b/slides/ansible-techlab/puzzle-demo.md @@ -2,11 +2,11 @@ ### ansible.puzzle.ch - +#### Lukas Grimm -#### Lukas Preisig + @@ -16,7 +16,7 @@ -#### Florian Studer + @@ -27,7 +27,7 @@ - - + - + *** ## Alle Puzzler -
-
-
-
+![](https://www.puzzle.ch/img/2024/06/2024_Gruppenfoto_Puzzle-16x9-1000px-Breit.jpg?w=1000&h=561&fit=crop&fm=webp&q=90&sharp=4&s=5ec79746d78173920f663ca911d9ce86)" ### Members https://www.puzzle.ch/de/team -
- *** @@ -783,6 +772,7 @@ Ein Play ist was, wo wie, gmacht wird "Baby-JSON" possible same as before: + ```yaml --- - hosts: web @@ -790,6 +780,7 @@ same as before: - name: install httpd yum: name=httpd state=installed ``` + Not Best Practice! @@ -848,6 +839,7 @@ Why? Where to define variables? *** ## Where to put variables defined in playbook: + ```yaml --- - hosts: web @@ -860,12 +852,14 @@ defined in playbook: name: "{{ my_package }}" state: installed ``` + *** ## Where to put variables `ansible-playbook myplay.yml --extra-vars my_package="nginx"` + Note: @@ -933,6 +927,7 @@ https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#unde Don't Name your Variables after Magic Variables *** + ## Bonus Level: Loops! ```yaml - name: start and enable two services @@ -951,11 +946,15 @@ Note: https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#migrating-to-loop + *** + # Lab 4.1: Ansible Playbooks - Variables and Loops + *** + ## Templates - "template" is a module