Skip to content
Snippets Groups Projects
Unverified Commit 36e5d742 authored by Arthur Outhenin-Chalandre's avatar Arthur Outhenin-Chalandre Committed by GitHub
Browse files

Resolve ansible-lint name errors (#10253)


* project: fix ansible-lint name

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: ignore jinja template error in names

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: capitalize ansible name

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* project: update notify after name capitalization

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

---------

Signed-off-by: default avatarArthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
parent b9e38613
Branches
Tags
No related merge requests found
Showing
with 70 additions and 55 deletions
......@@ -22,18 +22,7 @@ skip_list:
# (Disabled in Feb 2023)
- 'fqcn-builtins'
# names should start with an uppercase letter
# (Disabled in June 2023 after ansible upgrade; FIXME)
- 'name[casing]'
# Everything should be named
# (Disabled in June 2023 after ansible upgrade; FIXME)
- 'name[play]'
- 'name[missing]'
# templates should only be at the end of 'name'
# (Disabled in June 2023 after ansible upgrade; FIXME)
- 'name[jinja]'
# We use template in names
- 'name[template]'
# order of keys errors
......
---
- hosts: localhost
- name: Generate Azure inventory
hosts: localhost
gather_facts: False
roles:
- generate-inventory
---
- hosts: localhost
- name: Generate Azure inventory
hosts: localhost
gather_facts: False
roles:
- generate-inventory_2
---
- hosts: localhost
- name: Generate Azure templates
hosts: localhost
gather_facts: False
roles:
- generate-templates
---
- hosts: localhost
- name: Create nodes as docker containers
hosts: localhost
gather_facts: False
roles:
- { role: dind-host }
- hosts: containers
- name: Customize each node containers
hosts: containers
roles:
- { role: dind-cluster }
---
- name: set_fact distro_setup
- name: Set_fact distro_setup
set_fact:
distro_setup: "{{ distro_settings[node_distro] }}"
- name: set_fact other distro settings
- name: Set_fact other distro settings
set_fact:
distro_user: "{{ distro_setup['user'] }}"
distro_ssh_service: "{{ distro_setup['ssh_service'] }}"
......@@ -66,7 +66,7 @@
dest: "/etc/sudoers.d/{{ distro_user }}"
mode: 0640
- name: Add my pubkey to "{{ distro_user }}" user authorized keys
- name: "Add my pubkey to {{ distro_user }} user authorized keys"
ansible.posix.authorized_key:
user: "{{ distro_user }}"
state: present
......
---
- name: set_fact distro_setup
- name: Set_fact distro_setup
set_fact:
distro_setup: "{{ distro_settings[node_distro] }}"
- name: set_fact other distro settings
- name: Set_fact other distro settings
set_fact:
distro_image: "{{ distro_setup['image'] }}"
distro_init: "{{ distro_setup['init'] }}"
......
---
- hosts: localhost
- name: Prepare Hypervisor to later install kubespray VMs
hosts: localhost
gather_facts: False
become: yes
vars:
......
......@@ -22,9 +22,9 @@
- ntp
when: ansible_os_family == "Debian"
# Create deployment user if required
- include_tasks: user.yml
- name: Create deployment user if required
include_tasks: user.yml
when: k8s_deployment_user is defined
# Set proper sysctl values
- import_tasks: sysctl.yml
- name: Set proper sysctl values
import_tasks: sysctl.yml
......@@ -2,7 +2,8 @@
- name: Check ansible version
import_playbook: kubernetes_sigs.kubespray.ansible_version
- hosts: localhost
- name: Install mitogen
hosts: localhost
strategy: linear
vars:
mitogen_version: 0.3.2
......@@ -19,24 +20,24 @@
- "{{ playbook_dir }}/plugins/mitogen"
- "{{ playbook_dir }}/dist"
- name: download mitogen release
- name: Download mitogen release
get_url:
url: "{{ mitogen_url }}"
dest: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
validate_certs: true
mode: 0644
- name: extract archive
- name: Extract archive
unarchive:
src: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.tar.gz"
dest: "{{ playbook_dir }}/dist/"
- name: copy plugin
- name: Copy plugin
ansible.posix.synchronize:
src: "{{ playbook_dir }}/dist/mitogen-{{ mitogen_version }}/"
dest: "{{ playbook_dir }}/plugins/mitogen"
- name: add strategy to ansible.cfg
- name: Add strategy to ansible.cfg
community.general.ini_file:
path: ansible.cfg
mode: 0644
......
---
- hosts: gfs-cluster
- name: Bootstrap hosts
hosts: gfs-cluster
gather_facts: false
vars:
ansible_ssh_pipelining: false
roles:
- { role: bootstrap-os, tags: bootstrap-os}
- hosts: all
- name: Gather facts
hosts: all
gather_facts: true
- hosts: gfs-cluster
- name: Install glusterfs server
hosts: gfs-cluster
vars:
ansible_ssh_pipelining: true
roles:
- { role: glusterfs/server }
- hosts: k8s_cluster
- name: Install glusterfs servers
hosts: k8s_cluster
roles:
- { role: glusterfs/client }
- hosts: kube_control_plane[0]
- name: Configure Kubernetes to use glusterfs
hosts: kube_control_plane[0]
roles:
- { role: kubernetes-pv }
......@@ -3,10 +3,12 @@
# hyperkube and needs to be installed as part of the system.
# Setup/install tasks.
- include_tasks: setup-RedHat.yml
- name: Setup RedHat distros for glusterfs
include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat' and groups['gfs-cluster'] is defined
- include_tasks: setup-Debian.yml
- name: Setup Debian distros for glusterfs
include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian' and groups['gfs-cluster'] is defined
- name: Ensure Gluster mount directories exist.
......
......@@ -4,13 +4,13 @@
include_vars: "{{ ansible_os_family }}.yml"
# Install xfs package
- name: install xfs Debian
- name: Install xfs Debian
apt:
name: xfsprogs
state: present
when: ansible_os_family == "Debian"
- name: install xfs RedHat
- name: Install xfs RedHat
package:
name: xfsprogs
state: present
......@@ -23,7 +23,7 @@
dev: "{{ disk_volume_device_1 }}"
# Mount external volumes
- name: mounting new xfs filesystem
- name: Mounting new xfs filesystem
ansible.posix.mount:
name: "{{ gluster_volume_node_mount_dir }}"
src: "{{ disk_volume_device_1 }}"
......@@ -31,10 +31,12 @@
state: mounted
# Setup/install tasks.
- include_tasks: setup-RedHat.yml
- name: Setup RedHat distros for glusterfs
include_tasks: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include_tasks: setup-Debian.yml
- name: Setup Debian distros for glusterfs
include_tasks: setup-Debian.yml
when: ansible_os_family == 'Debian'
- name: Ensure GlusterFS is started and enabled at boot.
......
---
- hosts: kube_control_plane[0]
- name: Tear down heketi
hosts: kube_control_plane[0]
roles:
- { role: tear-down }
- hosts: heketi-node
- name: Teardown disks in heketi
hosts: heketi-node
become: yes
roles:
- { role: tear-down-disks }
---
- hosts: heketi-node
- name: Prepare heketi install
hosts: heketi-node
roles:
- { role: prepare }
- hosts: kube_control_plane[0]
- name: Provision heketi
hosts: kube_control_plane[0]
tags:
- "provision"
roles:
......
---
- name: "stop port forwarding"
- name: "Stop port forwarding"
command: "killall "
---
- hosts: localhost
- name: Collect container images for offline deployment
hosts: localhost
become: no
roles:
......@@ -11,7 +12,8 @@
tasks:
# Generate files.list and images.list files from templates.
- template:
- name: Collect container images for offline deployment
template:
src: ./contrib/offline/temp/{{ item }}.list.template
dest: ./contrib/offline/temp/{{ item }}.list
mode: 0644
......
---
- hosts: all
- name: Disable firewalld/ufw
hosts: all
roles:
- { role: prepare }
---
- block:
- name: Disable firewalld and ufw
block:
- name: List services
service_facts:
......
---
- hosts: kube_node:kube_control_plane
- name: Remove old cloud provider config
hosts: kube_node:kube_control_plane
tasks:
- name: Remove old cloud provider config
file:
......@@ -7,7 +8,8 @@
state: absent
with_items:
- /etc/kubernetes/cloud_config
- hosts: kube_control_plane[0]
- name: Migrate intree Cinder PV
hosts: kube_control_plane[0]
tasks:
- name: Include kubespray-default variables
include_vars: ../roles/kubespray-defaults/defaults/main.yaml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment