From 741dba69f08922f33a5fcf7d09f60aad565e885b Mon Sep 17 00:00:00 2001 From: Lukas Grimm Date: Fri, 6 Dec 2024 10:38:32 +0100 Subject: [PATCH] fix pipeline for slides (#218) * fix pipeline for slides * remove pullsecret that is not needed anymore * fix reveal * fix slides --- .github/workflows/build-slides.yaml | 12 ++++---- slides/Dockerfile | 13 ++------ slides/ansible-techlab/puzzle-demo.md | 43 +++++++++++++-------------- slides/index.html.patch | 4 +-- 4 files changed, 32 insertions(+), 40 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..933a95c4 100644 --- a/slides/Dockerfile +++ b/slides/Dockerfile @@ -4,14 +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 \ - && git clone https://:${PULLSECRET}@gitlab.puzzle.ch/pitc_members/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 @@ -19,10 +12,10 @@ 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} - + EXPOSE 8000 CMD ["npm", "start", "--", "--host=0.0.0.0"] 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 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 @@ - + - -+ ++ -