-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
fileignoreconfig: | ||
- filename: poetry.lock | ||
ignore_detectors: [filecontent] | ||
- filename: defaults/main.yml | ||
ignore_detectors: [filecontent] | ||
- filename: .github/workflows/release.yml | ||
ignore_detectors: [filecontent] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
--- | ||
# kubectl_release: v1.28 | ||
kubectl_state: present | ||
# k8s_repo_release: v1.28 | ||
k8s_repo_state: latest | ||
k8s_repo_keyring_debian: /etc/apt/keyrings/kubernetes-apt-keyring.gpg |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
--- | ||
- name: Converge | ||
|
||
hosts: all | ||
|
||
become: true | ||
roles: | ||
|
||
- nephelaiio.plugins | ||
- nephelaiio.kubectl | ||
- nephelaiio.k8s_repo |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
--- | ||
- name: Verify | ||
|
||
hosts: all | ||
|
||
gather_facts: true | ||
|
||
become: true | ||
|
||
tasks: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,52 @@ | ||
--- | ||
- name: Set kubectl install target release | ||
- name: Set Kubernetes repository version | ||
ansible.builtin.set_fact: | ||
kubectl_version: "{{ lookup('ansible.builtin.url', 'https://dl.k8s.io/release/stable.txt', split_lines=False) }}" | ||
when: kubectl_version is not defined | ||
k8s_repo_version: "{{ lookup('ansible.builtin.url', 'https://dl.k8s.io/release/stable.txt', split_lines=False) }}" | ||
when: k8s_repo_version is not defined | ||
|
||
- name: Set kubectl release facts | ||
- name: Set Kuberentes repository release facts | ||
ansible.builtin.set_fact: | ||
_kubectl_target: "{{ '.'.join(kubectl_version.split('.')[0:2]) }}" | ||
_k8s_repo_target: "{{ '.'.join(k8s_repo_version.split('.')[0:2]) }}" | ||
|
||
- name: Deploy on Debian systems | ||
- name: Configure Kubernetes apt repository | ||
when: ansible_os_family == "Debian" | ||
block: | ||
- name: Create tempfile | ||
ansible.builtin.tempfile: | ||
suffix: k8s | ||
|
||
- name: Set distribution facts | ||
ansible.builtin.set_fact: | ||
_apt_repo_url: "https://pkgs.k8s.io/core:/stable:/{{ _k8s_repo_target }}/deb" | ||
|
||
- name: Install Debian package helpers | ||
ansible.builtin.package: | ||
name: | ||
- apt-transport-https | ||
- ca-certificates | ||
- curl | ||
|
||
- name: Create keyring directory | ||
ansible.builtin.file: | ||
path: "{{ k8s_repo_keyring_debian | dirname }}" | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Install gpg certificate | ||
Check failure on line 37 in tasks/main.yml GitHub Actions / lintcommand-instead-of-module
Check failure on line 37 in tasks/main.yml GitHub Actions / lintrisky-shell-pipe
Check failure on line 37 in tasks/main.yml GitHub Actions / molecule (default, ubuntu2004, /lib/systemd/systemd)command-instead-of-module
Check failure on line 37 in tasks/main.yml GitHub Actions / molecule (default, ubuntu2004, /lib/systemd/systemd)risky-shell-pipe
Check failure on line 37 in tasks/main.yml GitHub Actions / molecule (default, debian11, /lib/systemd/systemd)command-instead-of-module
Check failure on line 37 in tasks/main.yml GitHub Actions / molecule (default, debian11, /lib/systemd/systemd)risky-shell-pipe
Check failure on line 37 in tasks/main.yml GitHub Actions / molecule (default, centos8, /usr/lib/systemd/systemd)command-instead-of-module
|
||
ansible.builtin.shell: | ||
cmd: >- | ||
curl -fsSL {{ _apt_repo_url }}/Release.key | gpg --dearmor -o {{ k8s_repo_keyring_debian }} | ||
executable: /bin/bash | ||
changed_when: false | ||
|
||
- name: Configure apt repository | ||
ansible.builtin.apt_repository: | ||
filename: k8s_repo | ||
repo: "deb [signed-by={{ k8s_repo_keyring_debian }}] {{ _apt_repo_url }} /" | ||
|
||
- name: Deploy on RedHat systems | ||
- name: Configure Kubernetes yum repository | ||
when: ansible_os_family == "RedHat" | ||
block: | ||
- fail: | ||
Check failure on line 52 in tasks/main.yml GitHub Actions / lintfqcn[action-core]
Check failure on line 52 in tasks/main.yml GitHub Actions / lintname[missing]
Check failure on line 52 in tasks/main.yml GitHub Actions / molecule (default, ubuntu2004, /lib/systemd/systemd)fqcn[action-core]
Check failure on line 52 in tasks/main.yml GitHub Actions / molecule (default, ubuntu2004, /lib/systemd/systemd)name[missing]
Check failure on line 52 in tasks/main.yml GitHub Actions / molecule (default, debian11, /lib/systemd/systemd)fqcn[action-core]
Check failure on line 52 in tasks/main.yml GitHub Actions / molecule (default, debian11, /lib/systemd/systemd)name[missing]
Check failure on line 52 in tasks/main.yml GitHub Actions / molecule (default, centos8, /usr/lib/systemd/systemd)fqcn[action-core]
|