Auto-fix yaml rules
In order to reduce divergance with ansible-lint rules, we apply auto-fixing of violations. In current patch we replace all kind of truthy variables with `true` or `false` values to align with recommendations along with alignment of used quotes. Change-Id: I84f2efb55945e0379f44fca8ddb7b92241c1d9ef
This commit is contained in:
parent
22b605abe4
commit
2aed220123
1
.gitignore
vendored
1
.gitignore
vendored
@ -45,6 +45,7 @@ logs/*
|
|||||||
# OS generated files #
|
# OS generated files #
|
||||||
######################
|
######################
|
||||||
._*
|
._*
|
||||||
|
.ansible
|
||||||
.tox
|
.tox
|
||||||
*.egg-info
|
*.egg-info
|
||||||
.eggs
|
.eggs
|
||||||
|
@ -59,7 +59,6 @@ lxc_host_machine_quota_disabled: false
|
|||||||
lxc_host_machine_qgroup_space_limit: none
|
lxc_host_machine_qgroup_space_limit: none
|
||||||
lxc_host_machine_qgroup_compression_limit: none
|
lxc_host_machine_qgroup_compression_limit: none
|
||||||
|
|
||||||
|
|
||||||
# DefaultTasksMax systemd value. It's not recommended to change this value as it
|
# DefaultTasksMax systemd value. It's not recommended to change this value as it
|
||||||
# could prevent new processes from starting on busy containers.
|
# could prevent new processes from starting on busy containers.
|
||||||
lxc_default_tasks_max: 8192
|
lxc_default_tasks_max: 8192
|
||||||
@ -98,30 +97,30 @@ lxc_net_bridge_type: linuxbridge
|
|||||||
lxc_net_address: 10.0.3.1
|
lxc_net_address: 10.0.3.1
|
||||||
lxc_net_netmask: 255.255.255.0
|
lxc_net_netmask: 255.255.255.0
|
||||||
lxc_net_cidr: 24
|
lxc_net_cidr: 24
|
||||||
lxc_net_gateway: null ## if null, no gateway will be on the LXC bridge. lxc_net_nat must be "false" to use a gateway.
|
lxc_net_gateway: ## if null, no gateway will be on the LXC bridge. lxc_net_nat must be "false" to use a gateway.
|
||||||
# lxc_net_mtu: 1500 ##setting this variable will add mtu configuration for the lxc config and network bridge
|
# lxc_net_mtu: 1500 ##setting this variable will add mtu configuration for the lxc config and network bridge
|
||||||
|
|
||||||
# lxc container nat enabled
|
# lxc container nat enabled
|
||||||
lxc_net_nat: true ## If "true", nat rules will be created with the lxc network.
|
lxc_net_nat: true ## If "true", nat rules will be created with the lxc network.
|
||||||
|
|
||||||
# Enable iptables for lxc network
|
# Enable iptables for lxc network
|
||||||
lxc_net_manage_iptables: true ## If "true" iptables rules will be added when the bridge is up and deleted when bridge is down
|
lxc_net_manage_iptables: true ## If "true" iptables rules will be added when the bridge is up and deleted when bridge is down
|
||||||
|
|
||||||
# lxc container dhcp settings
|
# lxc container dhcp settings
|
||||||
lxc_net_dhcp_range: 10.0.3.2,10.0.3.253
|
lxc_net_dhcp_range: 10.0.3.2,10.0.3.253
|
||||||
lxc_net_dhcp_max: 253
|
lxc_net_dhcp_max: 253
|
||||||
lxc_net_dhcp_config: ''
|
lxc_net_dhcp_config: ""
|
||||||
lxc_net_dnsmasq_user: lxc-dnsmasq
|
lxc_net_dnsmasq_user: lxc-dnsmasq
|
||||||
lxc_net_domain: ''
|
lxc_net_domain: ""
|
||||||
|
|
||||||
# lxc network ipv6 settings
|
# lxc network ipv6 settings
|
||||||
lxc_net6_address: null ## ie. fd05:ffb8:32b4:1212::1
|
lxc_net6_address: ## ie. fd05:ffb8:32b4:1212::1
|
||||||
lxc_net6_netmask: null ## ie. 64
|
lxc_net6_netmask: ## ie. 64
|
||||||
lxc_net6_nat: false
|
lxc_net6_nat: false
|
||||||
|
|
||||||
# System control kernel tuning
|
# System control kernel tuning
|
||||||
lxc_kernel_options:
|
lxc_kernel_options:
|
||||||
- { key: 'fs.inotify.max_user_instances', value: 1024 }
|
- { key: "fs.inotify.max_user_instances", value: 1024 }
|
||||||
|
|
||||||
# The compression ratio used when creating the container cache rootfs archive
|
# The compression ratio used when creating the container cache rootfs archive
|
||||||
lxc_image_compression_ratio: 0
|
lxc_image_compression_ratio: 0
|
||||||
@ -150,8 +149,8 @@ lxc_cache_prep_dns:
|
|||||||
|
|
||||||
# Custom shell commands to run before/after the LXC cache prep process has taken
|
# Custom shell commands to run before/after the LXC cache prep process has taken
|
||||||
# place.
|
# place.
|
||||||
lxc_cache_prep_pre_commands: '## pre command skipped ##'
|
lxc_cache_prep_pre_commands: "## pre command skipped ##"
|
||||||
lxc_cache_prep_post_commands: '## post command skipped ##'
|
lxc_cache_prep_post_commands: "## post command skipped ##"
|
||||||
|
|
||||||
# Full path to the base image prep script. By default this will use the
|
# Full path to the base image prep script. By default this will use the
|
||||||
# named script for a given OS within the "templates/prep-scripts" directory.
|
# named script for a given OS within the "templates/prep-scripts" directory.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
- name: Start apparmor
|
- name: Start apparmor
|
||||||
systemd:
|
systemd:
|
||||||
name: "apparmor"
|
name: "apparmor"
|
||||||
enabled: yes
|
enabled: true
|
||||||
state: "started"
|
state: "started"
|
||||||
|
|
||||||
- name: Reload apparmor
|
- name: Reload apparmor
|
||||||
@ -34,20 +34,20 @@
|
|||||||
name: "irqbalance"
|
name: "irqbalance"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
enabled: "yes"
|
enabled: "yes"
|
||||||
daemon_reload: yes
|
daemon_reload: true
|
||||||
|
|
||||||
- name: Bring bridge up
|
- name: Bring bridge up
|
||||||
command: "ip link set {{ lxc_net_bridge }} up" # noqa: no-changed-when
|
command: "ip link set {{ lxc_net_bridge }} up" # noqa: no-changed-when
|
||||||
|
|
||||||
- name: Reload systemd units
|
- name: Reload systemd units
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: true
|
||||||
|
|
||||||
- name: Restart sshd
|
- name: Restart sshd
|
||||||
service:
|
service:
|
||||||
name: sshd
|
name: sshd
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
enabled: yes
|
enabled: true
|
||||||
|
|
||||||
- name: Remove rootfs archive
|
- name: Remove rootfs archive
|
||||||
file:
|
file:
|
||||||
@ -59,7 +59,7 @@
|
|||||||
name: "lxc-dnsmasq"
|
name: "lxc-dnsmasq"
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
enabled: "yes"
|
enabled: "yes"
|
||||||
daemon_reload: yes
|
daemon_reload: true
|
||||||
register: _lxc_dnsmasq_systemd
|
register: _lxc_dnsmasq_systemd
|
||||||
until: _lxc_dnsmasq_systemd is success
|
until: _lxc_dnsmasq_systemd is success
|
||||||
retries: 5
|
retries: 5
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
lxc_image_cache_refresh: true
|
lxc_image_cache_refresh: true
|
||||||
when:
|
when:
|
||||||
cache_time | int >= (expiry.content | default('MQo=') | b64decode | int)
|
- cache_time | int >= (expiry.content | default('MQo=') | b64decode | int)
|
||||||
tags:
|
tags:
|
||||||
- always
|
- always
|
||||||
|
|
||||||
|
@ -31,14 +31,14 @@
|
|||||||
name: systemd_mount
|
name: systemd_mount
|
||||||
vars:
|
vars:
|
||||||
systemd_mounts:
|
systemd_mounts:
|
||||||
- what: '/var/lib/machines.raw'
|
- what: "/var/lib/machines.raw"
|
||||||
where: '/var/lib/machines'
|
where: "/var/lib/machines"
|
||||||
type: 'ext4'
|
type: "ext4"
|
||||||
options: 'loop'
|
options: "loop"
|
||||||
unit:
|
unit:
|
||||||
ConditionPathExists:
|
ConditionPathExists:
|
||||||
- '/var/lib/machines.raw'
|
- "/var/lib/machines.raw"
|
||||||
state: 'started'
|
state: "started"
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
- name: Remove the old image cache
|
- name: Remove the old image cache
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
apt:
|
apt:
|
||||||
pkg: "{{ lxc_hosts_remove_distro_packages }}"
|
pkg: "{{ lxc_hosts_remove_distro_packages }}"
|
||||||
state: absent
|
state: absent
|
||||||
purge: yes
|
purge: true
|
||||||
tags:
|
tags:
|
||||||
- lxc-apt-packages
|
- lxc-apt-packages
|
||||||
|
|
||||||
@ -26,7 +26,7 @@
|
|||||||
pkg: "{{ lxc_hosts_distro_packages }}"
|
pkg: "{{ lxc_hosts_distro_packages }}"
|
||||||
state: "{{ lxc_hosts_package_state }}"
|
state: "{{ lxc_hosts_package_state }}"
|
||||||
default_release: "{{ lxc_default_release | default(omit) }}"
|
default_release: "{{ lxc_default_release | default(omit) }}"
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
policy_rc_d: 101
|
policy_rc_d: 101
|
||||||
cache_valid_time: "{{ cache_timeout }}"
|
cache_valid_time: "{{ cache_timeout }}"
|
||||||
register: install_packages
|
register: install_packages
|
||||||
|
@ -23,13 +23,12 @@
|
|||||||
name: thm-lxc3.0
|
name: thm-lxc3.0
|
||||||
description: "Copr repo for lxc3.0 owned by thm"
|
description: "Copr repo for lxc3.0 owned by thm"
|
||||||
baseurl: "{{ lxc_centos_package_baseurl }}"
|
baseurl: "{{ lxc_centos_package_baseurl }}"
|
||||||
enabled: yes
|
enabled: true
|
||||||
gpgcheck: yes
|
gpgcheck: true
|
||||||
gpgkey: "{{ lxc_centos_package_key }}"
|
gpgkey: "{{ lxc_centos_package_key }}"
|
||||||
repo_gpgcheck: no
|
repo_gpgcheck: false
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
|
||||||
- name: Add GPG key for COPR LXC repo
|
- name: Add GPG key for COPR LXC repo
|
||||||
rpm_key:
|
rpm_key:
|
||||||
key: "{{ lxc_centos_package_key }}"
|
key: "{{ lxc_centos_package_key }}"
|
||||||
@ -39,7 +38,6 @@
|
|||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
|
|
||||||
|
|
||||||
- name: Download EPEL gpg keys
|
- name: Download EPEL gpg keys
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ lxc_centos_epel_key }}"
|
url: "{{ lxc_centos_epel_key }}"
|
||||||
@ -60,9 +58,9 @@
|
|||||||
name: epel-lxc_hosts
|
name: epel-lxc_hosts
|
||||||
baseurl: "{{ lxc_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
|
baseurl: "{{ lxc_centos_epel_mirror ~ '/' ~ ansible_facts['distribution_major_version'] ~ '/Everything/' ~ ansible_facts['architecture'] }}"
|
||||||
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
|
description: "Extra Packages for Enterprise Linux {{ ansible_facts['distribution_major_version'] }} - $basearch"
|
||||||
gpgcheck: yes
|
gpgcheck: true
|
||||||
gpgkey: "file:///etc/pki/rpm-gpg/{{ lxc_centos_epel_key.split('/')[-1] }}"
|
gpgkey: "file:///etc/pki/rpm-gpg/{{ lxc_centos_epel_key.split('/')[-1] }}"
|
||||||
enabled: yes
|
enabled: true
|
||||||
state: present
|
state: present
|
||||||
includepkgs: "systemd-networkd"
|
includepkgs: "systemd-networkd"
|
||||||
register: install_epel_repo
|
register: install_epel_repo
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# Copyright 2014, Rackspace US, Inc.
|
# Copyright 2014, Rackspace US, Inc.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -29,7 +28,7 @@
|
|||||||
- name: Ensure network services wait on networking (if using NetworkManager)
|
- name: Ensure network services wait on networking (if using NetworkManager)
|
||||||
service:
|
service:
|
||||||
name: NetworkManager-wait-online.service
|
name: NetworkManager-wait-online.service
|
||||||
enabled: yes
|
enabled: true
|
||||||
when: networkmanager_check.rc == 0
|
when: networkmanager_check.rc == 0
|
||||||
|
|
||||||
# NOTE(mhayden): There are systemd services that act like ifup/ifdown hooks
|
# NOTE(mhayden): There are systemd services that act like ifup/ifdown hooks
|
||||||
@ -38,7 +37,7 @@
|
|||||||
- name: Disable and stop lxc-net
|
- name: Disable and stop lxc-net
|
||||||
systemd:
|
systemd:
|
||||||
name: lxc-net
|
name: lxc-net
|
||||||
enabled: no
|
enabled: false
|
||||||
state: stopped
|
state: stopped
|
||||||
masked: true
|
masked: true
|
||||||
tags:
|
tags:
|
||||||
@ -63,7 +62,7 @@
|
|||||||
ForwardDelaySec: 0
|
ForwardDelaySec: 0
|
||||||
HelloTimeSec: 2
|
HelloTimeSec: 2
|
||||||
MaxAgeSec: 12
|
MaxAgeSec: 12
|
||||||
STP: off
|
STP: false
|
||||||
systemd_networkd_prefix: "lxc-net"
|
systemd_networkd_prefix: "lxc-net"
|
||||||
systemd_run_networkd: true
|
systemd_run_networkd: true
|
||||||
systemd_netdevs: "{{ (lxc_net_bridge_type == 'openvswitch') | ternary([], _lxc_net_bridge_devices) }}"
|
systemd_netdevs: "{{ (lxc_net_bridge_type == 'openvswitch') | ternary([], _lxc_net_bridge_devices) }}"
|
||||||
@ -73,7 +72,7 @@
|
|||||||
netmask: "{{ lxc_net_netmask }}"
|
netmask: "{{ lxc_net_netmask }}"
|
||||||
config_overrides:
|
config_overrides:
|
||||||
Network:
|
Network:
|
||||||
ConfigureWithoutCarrier: yes
|
ConfigureWithoutCarrier: true
|
||||||
Gateway: "{{ lxc_net_gateway is not none | ternary(lxc_net_gateway, {}) }}"
|
Gateway: "{{ lxc_net_gateway is not none | ternary(lxc_net_gateway, {}) }}"
|
||||||
|
|
||||||
- name: Run the systemd-service role
|
- name: Run the systemd-service role
|
||||||
@ -85,7 +84,7 @@
|
|||||||
systemd_services:
|
systemd_services:
|
||||||
- service_name: lxc-dnsmasq
|
- service_name: lxc-dnsmasq
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: true
|
||||||
execstartpres: |
|
execstartpres: |
|
||||||
{% set pres = ['-/usr/bin/pkill -u {{ lxc_net_dnsmasq_user }} "^dnsmasq"'] %}
|
{% set pres = ['-/usr/bin/pkill -u {{ lxc_net_dnsmasq_user }} "^dnsmasq"'] %}
|
||||||
{% if lxc_net_manage_iptables | bool %}
|
{% if lxc_net_manage_iptables | bool %}
|
||||||
|
@ -40,21 +40,23 @@ _lxc_cache_distro_libpython:
|
|||||||
bookworm: libpython3.11
|
bookworm: libpython3.11
|
||||||
noble: libpython3.12
|
noble: libpython3.12
|
||||||
|
|
||||||
_lxc_cache_need_systemd_resolved: "{{ ansible_facts['distribution'] == 'Debian' or
|
_lxc_cache_need_systemd_resolved: >-
|
||||||
(ansible_facts['distribution'] == 'Ubuntu' and
|
{{
|
||||||
ansible_facts['distribution_major_version'] is ansible.builtin.version('24', 'ge')) }}"
|
ansible_facts['distribution'] == 'Debian' or
|
||||||
|
(ansible_facts['distribution'] == 'Ubuntu' and ansible_facts['distribution_major_version'] is ansible.builtin.version('24', 'ge'))
|
||||||
|
}}
|
||||||
|
|
||||||
# This list should contain a minimum set of packages. Add extra packages via roles that require them.
|
# This list should contain a minimum set of packages. Add extra packages via roles that require them.
|
||||||
_lxc_cache_distro_packages:
|
_lxc_cache_distro_packages:
|
||||||
- ca-certificates
|
- ca-certificates
|
||||||
- dbus
|
- dbus
|
||||||
- git # needed everywhere when wheel_build=false
|
- git # needed everywhere when wheel_build=false
|
||||||
- iputils-ping
|
- iputils-ping
|
||||||
- iproute2
|
- iproute2
|
||||||
- libxml2
|
- libxml2
|
||||||
- locales
|
- locales
|
||||||
- netbase
|
- netbase
|
||||||
- procps # needed for sysctl-container.service
|
- procps # needed for sysctl-container.service
|
||||||
- python3
|
- python3
|
||||||
- "{{ _lxc_cache_distro_libpython[ansible_facts['distribution_release'] | lower] }}"
|
- "{{ _lxc_cache_distro_libpython[ansible_facts['distribution_release'] | lower] }}"
|
||||||
- sudo
|
- sudo
|
||||||
|
@ -38,7 +38,7 @@ _lxc_cache_prep_template: "prep-scripts/redhat_prep.sh.j2"
|
|||||||
|
|
||||||
_lxc_cache_distro_packages:
|
_lxc_cache_distro_packages:
|
||||||
- ca-certificates
|
- ca-certificates
|
||||||
- git-core # needed everywhere when wheel_build=false
|
- git-core # needed everywhere when wheel_build=false
|
||||||
- iputils
|
- iputils
|
||||||
- iproute
|
- iproute
|
||||||
- libxml2
|
- libxml2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user