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: I3978b58a26db45f2efd06aaca0cd8be508bd0653
This commit is contained in:
parent
80afdc7fba
commit
d33faaf5c3
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
|
||||||
|
@ -18,7 +18,7 @@ systemd_group_name: root
|
|||||||
systemd_slice_name: system
|
systemd_slice_name: system
|
||||||
|
|
||||||
# Restart services when a change occurs
|
# Restart services when a change occurs
|
||||||
systemd_service_restart_changed: yes
|
systemd_service_restart_changed: true
|
||||||
|
|
||||||
# This is the prefix used for all temp files of a given type.
|
# This is the prefix used for all temp files of a given type.
|
||||||
systemd_tempd_prefix: tempd
|
systemd_tempd_prefix: tempd
|
||||||
@ -53,7 +53,7 @@ systemd_after_targets:
|
|||||||
systemd_unit_docs: []
|
systemd_unit_docs: []
|
||||||
|
|
||||||
# Set the service enabled state. Valid options are: [yes, no]
|
# Set the service enabled state. Valid options are: [yes, no]
|
||||||
systemd_service_enabled: yes
|
systemd_service_enabled: true
|
||||||
|
|
||||||
# Set global service overrides used within the service unit file.
|
# Set global service overrides used within the service unit file.
|
||||||
systemd_service_config_overrides: {}
|
systemd_service_config_overrides: {}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
- name: Create a systemd unit file for ServiceX
|
- name: Create a systemd unit file for ServiceX
|
||||||
hosts: localhost
|
hosts: localhost
|
||||||
become: true
|
become: true
|
||||||
@ -13,7 +12,7 @@
|
|||||||
After: network-online.target
|
After: network-online.target
|
||||||
Wants: network-online.target
|
Wants: network-online.target
|
||||||
Service:
|
Service:
|
||||||
RemainAfterExit: yes
|
RemainAfterExit: true
|
||||||
service_type: oneshot
|
service_type: oneshot
|
||||||
execstarts:
|
execstarts:
|
||||||
- "/bin/bash -c 'echo start1'"
|
- "/bin/bash -c 'echo start1'"
|
||||||
@ -21,7 +20,7 @@
|
|||||||
execstops:
|
execstops:
|
||||||
- "/bin/bash -c 'echo stop1'"
|
- "/bin/bash -c 'echo stop1'"
|
||||||
- "/bin/bash -c 'echo stop2'"
|
- "/bin/bash -c 'echo stop2'"
|
||||||
enabled: yes
|
enabled: true
|
||||||
state: started
|
state: started
|
||||||
systemd_tempd_prefix: openstack
|
systemd_tempd_prefix: openstack
|
||||||
systemd_lock_path: /var/lock/networking
|
systemd_lock_path: /var/lock/networking
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
include_tasks: handlers/socket_restart.yml
|
include_tasks: handlers/socket_restart.yml
|
||||||
listen: systemd socket changed
|
listen: systemd socket changed
|
||||||
when:
|
when:
|
||||||
- 'socket_results is changed'
|
- "socket_results is changed"
|
||||||
loop: "{{ systemd_socket.results }}"
|
loop: "{{ systemd_socket.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: socket_results
|
loop_var: socket_results
|
||||||
@ -28,7 +28,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- systemd-service
|
- systemd-service
|
||||||
|
|
||||||
|
|
||||||
- name: Restart changed services
|
- name: Restart changed services
|
||||||
include_tasks: handlers/systemd_restart.yml
|
include_tasks: handlers/systemd_restart.yml
|
||||||
vars:
|
vars:
|
||||||
@ -42,10 +41,10 @@
|
|||||||
tags:
|
tags:
|
||||||
- systemd-service
|
- systemd-service
|
||||||
when:
|
when:
|
||||||
- 'services_results.item.restart_changed | default(systemd_service_restart_changed) | bool'
|
- services_results.item.restart_changed | default(systemd_service_restart_changed) | bool
|
||||||
- 'services_results.item.state is not defined'
|
- services_results.item.state is not defined
|
||||||
- 'services_results.item.enabled | default(systemd_service_enabled) | bool'
|
- services_results.item.enabled | default(systemd_service_enabled) | bool
|
||||||
- 'services_results is changed'
|
- services_results is changed
|
||||||
loop: "{{ systemd_services_result.results }}"
|
loop: "{{ systemd_services_result.results }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: services_results
|
loop_var: services_results
|
||||||
|
@ -162,7 +162,7 @@
|
|||||||
|
|
||||||
- name: Reload systemd on unit change
|
- name: Reload systemd on unit change
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: yes
|
daemon_reload: true
|
||||||
when:
|
when:
|
||||||
- (systemd_services_result is changed) or
|
- (systemd_services_result is changed) or
|
||||||
(systemd_timer_result is changed) or
|
(systemd_timer_result is changed) or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user