chore: add and apply yamllint
This commit is contained in:
parent
8964946374
commit
f65b92fe69
50 changed files with 722 additions and 701 deletions
|
|
@ -1,8 +1,9 @@
|
|||
---
|
||||
- name: Apply base configuration
|
||||
hosts:
|
||||
- k3s_agents
|
||||
- k3s_masters
|
||||
- k3s_agents
|
||||
- k3s_masters
|
||||
|
||||
roles:
|
||||
- role: ../roles/base
|
||||
become: yes
|
||||
- role: ../roles/base
|
||||
become: true
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
- name: Install k3s nodes
|
||||
hosts:
|
||||
- k3s_masters
|
||||
- k3s_agents
|
||||
- k3s_masters
|
||||
- k3s_agents
|
||||
|
||||
roles:
|
||||
- role: ../roles/k3s
|
||||
become: yes
|
||||
vars:
|
||||
first_master_hostname: "{{ groups['k3s_masters'][0] }}"
|
||||
is_first_master: "{{ inventory_hostname in groups['k3s_masters'][0] }}"
|
||||
short_hostname: "{{ inventory_hostname.split('.')[0] }}"
|
||||
- role: ../roles/k3s
|
||||
become: true
|
||||
vars:
|
||||
first_master_hostname: "{{ groups['k3s_masters'][0] }}"
|
||||
is_first_master: "{{ inventory_hostname in groups['k3s_masters'][0] }}"
|
||||
short_hostname: "{{ inventory_hostname.split('.')[0] }}"
|
||||
|
|
|
|||
|
|
@ -1,36 +1,36 @@
|
|||
---
|
||||
- name: Set same timezone on every Server
|
||||
community.general.timezone:
|
||||
name: "{{ system_timezone }}"
|
||||
name: '{{ system_timezone }}'
|
||||
when: (system_timezone is defined) and (system_timezone != "Europe/Madrid")
|
||||
|
||||
- name: Enable IPv4 forwarding
|
||||
ansible.posix.sysctl:
|
||||
name: net.ipv4.ip_forward
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
name: net.ipv4.ip_forward
|
||||
value: '1'
|
||||
state: present
|
||||
reload: true
|
||||
|
||||
- name: Enable IPv6 forwarding
|
||||
ansible.posix.sysctl:
|
||||
name: net.ipv6.conf.all.forwarding
|
||||
value: "1"
|
||||
state: present
|
||||
reload: yes
|
||||
name: net.ipv6.conf.all.forwarding
|
||||
value: '1'
|
||||
state: present
|
||||
reload: true
|
||||
|
||||
- name: Enable IPv6 router advertisements
|
||||
ansible.posix.sysctl:
|
||||
name: net.ipv6.conf.all.accept_ra
|
||||
value: "2"
|
||||
state: present
|
||||
reload: yes
|
||||
name: net.ipv6.conf.all.accept_ra
|
||||
value: '2'
|
||||
state: present
|
||||
reload: true
|
||||
|
||||
- import_tasks: packages.yml
|
||||
name: Install base packages
|
||||
tags:
|
||||
- packages
|
||||
- packages
|
||||
|
||||
- import_tasks: mounts.yml
|
||||
name: Mount NFS shares
|
||||
tags:
|
||||
- nfs
|
||||
- nfs
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
- name: Create mountpoint directory
|
||||
file:
|
||||
path: /nfs/nas1
|
||||
state: directory
|
||||
owner: 10000
|
||||
group: 10000
|
||||
path: /nfs/nas1
|
||||
state: directory
|
||||
owner: 10000
|
||||
group: 10000
|
||||
|
||||
- name: Mount nas1 share
|
||||
mount:
|
||||
fstype: nfs
|
||||
src: zeruel.fuku:/mnt/pool1/nas1
|
||||
path: /nfs/nas1
|
||||
state: mounted
|
||||
fstab: /etc/fstab
|
||||
opts: _netdev,nofail,tcp,bg,retrans=2,timeo=150,rsize=32768,wsize=32768,noresvport
|
||||
backup: true
|
||||
become: yes
|
||||
fstype: nfs
|
||||
src: zeruel.fuku:/mnt/pool1/nas1
|
||||
path: /nfs/nas1
|
||||
state: mounted
|
||||
fstab: /etc/fstab
|
||||
opts: _netdev,nofail,tcp,bg,retrans=2,timeo=150,rsize=32768,wsize=32768,noresvport
|
||||
backup: true
|
||||
become: true
|
||||
become_user: root
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
---
|
||||
- name: Install base packages
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
update_cache: yes
|
||||
name: '{{ item }}'
|
||||
state: present
|
||||
update_cache: true
|
||||
loop:
|
||||
- qemu-guest-agent
|
||||
- git
|
||||
- tmux
|
||||
- vim
|
||||
- curl
|
||||
- nfs-common
|
||||
- qemu-guest-agent
|
||||
- git
|
||||
- tmux
|
||||
- vim
|
||||
- curl
|
||||
- nfs-common
|
||||
|
||||
- name: Update all packages
|
||||
apt:
|
||||
upgrade: dist
|
||||
update_cache: yes
|
||||
upgrade: dist
|
||||
update_cache: true
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
- name: Create rancher folder
|
||||
file:
|
||||
state: directory
|
||||
path: /etc/rancher/k3s
|
||||
owner: root
|
||||
group: root
|
||||
mode: 755
|
||||
state: directory
|
||||
path: /etc/rancher/k3s
|
||||
owner: root
|
||||
group: root
|
||||
mode: 755
|
||||
|
||||
- name: Copy k3s config file
|
||||
template:
|
||||
src: agent.config.yaml.j2
|
||||
dest: /etc/rancher/k3s/config.yaml
|
||||
mode: 600
|
||||
src: agent.config.yaml.j2
|
||||
dest: /etc/rancher/k3s/config.yaml
|
||||
mode: 600
|
||||
|
||||
- name: Install k3s agent
|
||||
shell: "bash /tmp/k3s.install.sh agent"
|
||||
shell: bash /tmp/k3s.install.sh agent
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
- name: Create .kube directory
|
||||
become: yes
|
||||
become: true
|
||||
file:
|
||||
path: /home/ci/.kube
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: ci
|
||||
group: ci
|
||||
path: /home/ci/.kube
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: ci
|
||||
group: ci
|
||||
|
||||
- name: Copy kubeconfig
|
||||
copy:
|
||||
remote_src: true
|
||||
src: /etc/rancher/k3s/k3s.yaml
|
||||
dest: /home/ci/.kube/config
|
||||
mode: 0644
|
||||
owner: ci
|
||||
group: ci
|
||||
become: yes
|
||||
remote_src: true
|
||||
src: /etc/rancher/k3s/k3s.yaml
|
||||
dest: /home/ci/.kube/config
|
||||
mode: 0644
|
||||
owner: ci
|
||||
group: ci
|
||||
become: true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Download k3s script
|
||||
get_url:
|
||||
url: https://get.k3s.io
|
||||
dest: /tmp/k3s.install.sh
|
||||
url: https://get.k3s.io
|
||||
dest: /tmp/k3s.install.sh
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
- import_tasks: download.yml
|
||||
name: Download install script
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
---
|
||||
- name: Create rancher folder
|
||||
file:
|
||||
state: directory
|
||||
path: /etc/rancher/k3s
|
||||
owner: root
|
||||
group: root
|
||||
mode: 755
|
||||
state: directory
|
||||
path: /etc/rancher/k3s
|
||||
owner: root
|
||||
group: root
|
||||
mode: 755
|
||||
|
||||
- name: Copy k3s config file
|
||||
template:
|
||||
src: master.config.yaml.j2
|
||||
dest: /etc/rancher/k3s/config.yaml
|
||||
mode: 600
|
||||
src: master.config.yaml.j2
|
||||
dest: /etc/rancher/k3s/config.yaml
|
||||
mode: 600
|
||||
vars:
|
||||
etcd_snapshot_dir: "/nfs/nas1/backups/{{ short_hostname }}"
|
||||
etcd_snapshot_dir: /nfs/nas1/backups/{{ short_hostname }}
|
||||
|
||||
- name: Install k3s master
|
||||
command: bash /tmp/k3s.install.sh
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
---
|
||||
k3s_version: "v1.27.4+k3s1"
|
||||
k3s_version: v1.27.4+k3s1
|
||||
tls_san: "{{ lookup('env', 'ANSIBLE_TLS_SAN') | mandatory }}"
|
||||
cluster_token: "{{ lookup('env', 'ANSIBLE_CLUSTER_TOKEN') | mandatory }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue