mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-28 11:42:37 +01:00
Compare commits
15 Commits
01d4bb8f8a
...
903f302236
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
903f302236 | ||
|
|
c54a1c62ef | ||
|
|
e5a1da1913 | ||
|
|
f239f8eb39 | ||
|
|
ddcbeadde1 | ||
|
|
d7a9a8db76 | ||
|
|
e0ecd44c8c | ||
|
|
b928c930d5 | ||
|
|
83c586654f | ||
|
|
b00f020e82 | ||
|
|
c8efd7de12 | ||
|
|
62d37e1242 | ||
|
|
31b36869c7 | ||
|
|
40d7a0ba5a | ||
|
|
7a2062af39 |
51
.github/workflows/cache.yml
vendored
51
.github/workflows/cache.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
molecule:
|
molecule:
|
||||||
name: cache
|
name: cache
|
||||||
runs-on: macos-13
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
|
|
||||||
@@ -58,30 +58,41 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
vagrant-boxes
|
vagrant-boxes
|
||||||
|
|
||||||
- name: Configure Homebrew cache
|
- name: install apt packages
|
||||||
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
|
||||||
id: cache-homebrew
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/Library/Caches/Homebrew
|
|
||||||
key: brew-${{ hashFiles('./Brewfile') }}
|
|
||||||
restore-keys: brew-
|
|
||||||
|
|
||||||
- name: Update Homebrew
|
|
||||||
if: | # only run if false since this is just a cache step
|
|
||||||
steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-vagrant.outputs.cache-hit != 'true'
|
|
||||||
run: |
|
run: |
|
||||||
brew update --preinstall
|
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
|
||||||
|
sudo apt update && sudo apt -y install vagrant virtualbox
|
||||||
|
|
||||||
- name: Install Homebrew dependencies
|
|
||||||
if: | # only run if false since this is just a cache step
|
# - name: Configure Homebrew cache
|
||||||
steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-cache-vagrant.outputs.cache-hit != 'true'
|
# uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
run: |
|
# id: cache-homebrew
|
||||||
env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
# with:
|
||||||
|
# path: |
|
||||||
|
# ~/Library/Caches/Homebrew
|
||||||
|
# key: brew-${{ hashFiles('./Brewfile') }}
|
||||||
|
# restore-keys: brew-
|
||||||
|
|
||||||
|
# - name: Update Homebrew
|
||||||
|
# if: | # only run if false since this is just a cache step
|
||||||
|
# steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-vagrant.outputs.cache-hit != 'true'
|
||||||
|
# run: |
|
||||||
|
# brew update --preinstall
|
||||||
|
|
||||||
|
# - name: Install Homebrew dependencies
|
||||||
|
# if: | # only run if false since this is just a cache step
|
||||||
|
# steps.cache-homebrew.outputs.cache-hit != 'true' || steps.cache-cache-vagrant.outputs.cache-hit != 'true'
|
||||||
|
# run: |
|
||||||
|
# env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
||||||
|
# vagrant --version
|
||||||
|
# vboxmanage --version
|
||||||
|
|
||||||
- name: Download Vagrant boxes for all scenarios
|
- name: Download Vagrant boxes for all scenarios
|
||||||
# To save some cache space, all scenarios share the same cache key.
|
# To save some cache space, all scenarios share the same cache key.
|
||||||
# On the other hand, this means that the cache contents should be
|
# On the other hand, this means that the cache contents should be
|
||||||
# the same across all scenarios. This step ensures that.
|
# the same across all scenarios. This step ensures that.
|
||||||
if: steps.cache-vagrant.outputs.cache-hit != 'true' # only run if false since this is just a cache step
|
if: steps.cache-vagrant.outputs.cache-hit != 'true' # only run if false since this is just a cache step
|
||||||
run: ./.github/download-boxes.sh
|
run: |
|
||||||
|
./.github/download-boxes.sh
|
||||||
|
vagrant box list
|
||||||
|
|||||||
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -8,11 +8,11 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**/README.md'
|
- '**/README.md'
|
||||||
jobs:
|
jobs:
|
||||||
cache:
|
pre:
|
||||||
uses: ./.github/workflows/cache.yml
|
uses: ./.github/workflows/cache.yml
|
||||||
lint:
|
lint:
|
||||||
uses: ./.github/workflows/lint.yml
|
uses: ./.github/workflows/lint.yml
|
||||||
needs: [cache]
|
needs: [pre]
|
||||||
test:
|
test:
|
||||||
uses: ./.github/workflows/test.yml
|
uses: ./.github/workflows/test.yml
|
||||||
needs: [cache, lint]
|
needs: [pre, lint]
|
||||||
|
|||||||
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
pre-commit-ci:
|
pre-commit-ci:
|
||||||
name: Pre-Commit
|
name: Pre-Commit
|
||||||
runs-on: macos-13
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.11"
|
PYTHON_VERSION: "3.11"
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
|
|
||||||
ensure-pinned-actions:
|
ensure-pinned-actions:
|
||||||
name: Ensure SHA Pinned Actions
|
name: Ensure SHA Pinned Actions
|
||||||
runs-on: macos-13
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
|
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v3 2.5.0
|
||||||
|
|||||||
32
.github/workflows/test.yml
vendored
32
.github/workflows/test.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
molecule:
|
molecule:
|
||||||
name: Molecule
|
name: Molecule
|
||||||
runs-on: macos-13
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
scenario:
|
scenario:
|
||||||
@@ -41,20 +41,28 @@ jobs:
|
|||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
|
|
||||||
- name: Restore Homebrew cache
|
# - name: Restore Homebrew cache
|
||||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
# uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
with:
|
# with:
|
||||||
path: |
|
# path: |
|
||||||
~/Library/Caches/Homebrew
|
# ~/Library/Caches/Homebrew
|
||||||
key: brew-${{ hashFiles('./Brewfile') }}
|
# key: brew-${{ hashFiles('./Brewfile') }}
|
||||||
|
|
||||||
- name: Update Homebrew
|
# - name: Update Homebrew
|
||||||
run: |
|
# run: |
|
||||||
brew update --preinstall
|
# brew update --preinstall
|
||||||
|
|
||||||
- name: Install Homebrew dependencies
|
# - name: Install Homebrew dependencies
|
||||||
|
# run: |
|
||||||
|
# env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
||||||
|
# vagrant --version
|
||||||
|
# vboxmanage --version
|
||||||
|
|
||||||
|
- name: install apt packages
|
||||||
run: |
|
run: |
|
||||||
env HOMEBREW_NO_AUTO_UPDATE=1 brew bundle --no-upgrade --file ./Brewfile
|
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
|
||||||
|
sudo apt update && sudo apt -y install vagrant virtualbox
|
||||||
|
|
||||||
- name: Restore vagrant Boxes cache
|
- name: Restore vagrant Boxes cache
|
||||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # 4.0
|
||||||
|
|||||||
2
Brewfile
2
Brewfile
@@ -1,5 +1,5 @@
|
|||||||
tap "homebrew/bundle"
|
tap "homebrew/bundle"
|
||||||
tap "homebrew/cask-versions"
|
tap "hashicorp/tap"
|
||||||
|
|
||||||
cask "virtualbox"
|
cask "virtualbox"
|
||||||
cask "vagrant"
|
cask "vagrant"
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
dependency:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
|
options:
|
||||||
|
requirements-file: collections/requirements.yml
|
||||||
driver:
|
driver:
|
||||||
name: vagrant
|
name: vagrant
|
||||||
platforms:
|
platforms:
|
||||||
@@ -8,7 +10,7 @@ platforms:
|
|||||||
- name: control1
|
- name: control1
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- master
|
- master
|
||||||
@@ -24,7 +26,7 @@ platforms:
|
|||||||
- name: control2
|
- name: control2
|
||||||
box: generic/debian11
|
box: generic/debian11
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- master
|
- master
|
||||||
@@ -35,7 +37,7 @@ platforms:
|
|||||||
- name: control3
|
- name: control3
|
||||||
box: generic/rocky9
|
box: generic/rocky9
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- master
|
- master
|
||||||
@@ -46,7 +48,7 @@ platforms:
|
|||||||
- name: node1
|
- name: node1
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- node
|
- node
|
||||||
@@ -62,7 +64,7 @@ platforms:
|
|||||||
- name: node2
|
- name: node2
|
||||||
box: generic/rocky9
|
box: generic/rocky9
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- node
|
- node
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
---
|
---
|
||||||
dependency:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
|
options:
|
||||||
|
requirements-file: collections/requirements.yml
|
||||||
driver:
|
driver:
|
||||||
name: vagrant
|
name: vagrant
|
||||||
platforms:
|
platforms:
|
||||||
- name: control1
|
- name: control1
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- master
|
- master
|
||||||
@@ -23,7 +25,7 @@ platforms:
|
|||||||
- name: control2
|
- name: control2
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- master
|
- master
|
||||||
@@ -39,7 +41,7 @@ platforms:
|
|||||||
- name: node1
|
- name: node1
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
groups:
|
groups:
|
||||||
- k3s_cluster
|
- k3s_cluster
|
||||||
- node
|
- node
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
---
|
---
|
||||||
dependency:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
|
options:
|
||||||
|
requirements-file: collections/requirements.yml
|
||||||
driver:
|
driver:
|
||||||
name: vagrant
|
name: vagrant
|
||||||
platforms:
|
platforms:
|
||||||
- name: control1
|
- name: control1
|
||||||
box: generic/ubuntu2204
|
box: generic/ubuntu2204
|
||||||
memory: 512
|
memory: 512
|
||||||
cpus: 2
|
cpus: 1
|
||||||
config_options:
|
config_options:
|
||||||
# We currently can not use public-key based authentication on Ubuntu 22.04,
|
# We currently can not use public-key based authentication on Ubuntu 22.04,
|
||||||
# see: https://github.com/chef/bento/issues/1405
|
# see: https://github.com/chef/bento/issues/1405
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ ansible-core>=2.16.2
|
|||||||
jmespath>=1.0.1
|
jmespath>=1.0.1
|
||||||
jsonpatch>=1.33
|
jsonpatch>=1.33
|
||||||
kubernetes>=29.0.0
|
kubernetes>=29.0.0
|
||||||
molecule-vagrant>=2.0.0
|
molecule-plugins[vagrant]
|
||||||
molecule>=6.0.3
|
molecule>=6.0.3
|
||||||
netaddr>=0.10.1
|
netaddr>=0.10.1
|
||||||
pre-commit>=3.6.0
|
pre-commit>=3.6.0
|
||||||
|
|||||||
@@ -39,8 +39,6 @@ cryptography==41.0.7
|
|||||||
# via ansible-core
|
# via ansible-core
|
||||||
distlib==0.3.8
|
distlib==0.3.8
|
||||||
# via virtualenv
|
# via virtualenv
|
||||||
distro==1.9.0
|
|
||||||
# via selinux
|
|
||||||
enrich==1.2.7
|
enrich==1.2.7
|
||||||
# via molecule
|
# via molecule
|
||||||
filelock==3.13.1
|
filelock==3.13.1
|
||||||
@@ -55,7 +53,6 @@ jinja2==3.1.3
|
|||||||
# via
|
# via
|
||||||
# ansible-core
|
# ansible-core
|
||||||
# molecule
|
# molecule
|
||||||
# molecule-vagrant
|
|
||||||
jmespath==1.0.1
|
jmespath==1.0.1
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
jsonpatch==1.33
|
jsonpatch==1.33
|
||||||
@@ -79,8 +76,8 @@ mdurl==0.1.2
|
|||||||
molecule==6.0.3
|
molecule==6.0.3
|
||||||
# via
|
# via
|
||||||
# -r requirements.in
|
# -r requirements.in
|
||||||
# molecule-vagrant
|
# molecule-plugins
|
||||||
molecule-vagrant==2.0.0
|
molecule-plugins[vagrant]==23.5.0
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
netaddr==0.10.1
|
netaddr==0.10.1
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
@@ -116,7 +113,7 @@ pygments==2.17.2
|
|||||||
python-dateutil==2.8.2
|
python-dateutil==2.8.2
|
||||||
# via kubernetes
|
# via kubernetes
|
||||||
python-vagrant==1.0.0
|
python-vagrant==1.0.0
|
||||||
# via molecule-vagrant
|
# via molecule-plugins
|
||||||
pyyaml==6.0.1
|
pyyaml==6.0.1
|
||||||
# via
|
# via
|
||||||
# -r requirements.in
|
# -r requirements.in
|
||||||
@@ -124,7 +121,6 @@ pyyaml==6.0.1
|
|||||||
# ansible-core
|
# ansible-core
|
||||||
# kubernetes
|
# kubernetes
|
||||||
# molecule
|
# molecule
|
||||||
# molecule-vagrant
|
|
||||||
# pre-commit
|
# pre-commit
|
||||||
referencing==0.32.1
|
referencing==0.32.1
|
||||||
# via
|
# via
|
||||||
@@ -152,8 +148,6 @@ ruamel-yaml==0.18.5
|
|||||||
# via pre-commit-hooks
|
# via pre-commit-hooks
|
||||||
ruamel-yaml-clib==0.2.8
|
ruamel-yaml-clib==0.2.8
|
||||||
# via ruamel-yaml
|
# via ruamel-yaml
|
||||||
selinux==0.3.0
|
|
||||||
# via molecule-vagrant
|
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
# via
|
# via
|
||||||
# kubernetes
|
# kubernetes
|
||||||
|
|||||||
Reference in New Issue
Block a user