-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from ricsanfre/fix/ansiblelint
Ansible playbooks refactoring for solving ansible-lint issues
- Loading branch information
Showing
6 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,5 @@ | |
path: /boot/firmware/config.txt | ||
line: "gpu_mem=16" | ||
create: true | ||
mode: 0755 | ||
notify: reboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
--- | ||
|
||
- name: Get K3s installation script | ||
get_url: | ||
url: https://get.k3s.io | ||
dest: /tmp/k3s_install.sh | ||
mode: '0766' | ||
|
||
- name: Install K3s | ||
shell: | ||
cmd: "curl -sfL https://get.k3s.io | K3S_URL='https://{{ k3s_master_ip }}:6443' K3S_TOKEN={{ k3s_token }} sh -s - {{ k3s_worker_extra_args }}" | ||
command: "/tmp/k3s_install.sh {{ k3s_worker_extra_args }}" | ||
environment: | ||
K3S_TOKEN: "{{ k3s_token }}" | ||
K3S_URL: "https://{{ k3s_master_ip }}:6443" | ||
changed_when: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,50 @@ | ||
--- | ||
- name: Clean Longhorn storage | ||
shell: "rm -rf /storage/*" | ||
args: | ||
executable: /bin/bash | ||
changed_when: true | ||
|
||
- name: Clean Longhorn storage | get content | ||
become: true | ||
find: | ||
paths: /storage | ||
patterns: '*' | ||
file_type: any | ||
hidden: true | ||
register: directory_content_result | ||
|
||
- name: Clean Longhorn storage | delete content | ||
become: true | ||
file: | ||
path: "{{ item.path }}" | ||
state: absent | ||
with_items: "{{ directory_content_result.files }}" | ||
|
||
- name: Clean longhorn iscsi targets and nodes | ||
shell: | | ||
set -o pipefail | ||
for i in `sudo iscsiadm -m discovery -o show | grep -v 10.0.0.1 | awk '{print $1}'` | ||
do | ||
echo "Deleting target $i" | ||
sudo iscsiadm -m discovery -p $i -o delete | ||
done | ||
args: | ||
executable: /bin/bash | ||
register: output | ||
changed_when: true | ||
|
||
- name: Clean container/pod logs | ||
shell: "rm -rf /var/log/pods /var/log/containers" | ||
args: | ||
executable: /bin/bash | ||
ignore_errors: true | ||
changed_when: true | ||
file: | ||
path: "{{ item }}" | ||
state: absent | ||
with_items: | ||
- "/var/log/pods" | ||
- "/var/log/containers" | ||
|
||
- name: Clean fluentd pos files | ||
shell: "rm /var/log/*.pos" | ||
args: | ||
executable: /bin/bash | ||
ignore_errors: true | ||
changed_when: true | ||
- name: Clean fluentd pos files | get pos files | ||
find: | ||
paths: /var/log | ||
patterns: '*.pos' | ||
register: files_to_delete | ||
|
||
- name: Clean fluentd pos files | delete pos files | ||
file: | ||
path: "{{ item.path }}" | ||
state: absent | ||
with_items: "{{ files_to_delete.files }}" |