Fix yamllint issues and make it blocker
All yamllint issues in yaml files have been fixed except line-length rule
which is excluded. tox.ini is updated in order not to ignore yamllint issues
so if yamllint fails, the change will get verified-1 and will be blocked from
merging. yamllint configuration file, .yamllint, is also created to configure
what is enforced.
As a summary, most frequently occurring issues that are fixed are below.
- truthy value: must be true/false and not yes/no
- indentation: blocks are incorrectly indented mostly
- braces: extra spaces after opening and before closing curly braces are not good
- colons: extra spaces after colons - should be single
- missing document start
- comments: there should be a space after hash
Change-Id: I0d1341f2639585228b1ae8fd6ee073e5cae53604
diff --git a/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml b/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
index d113e50..58e2c72 100644
--- a/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
+++ b/playbooks/roles/configure-targethosts/tasks/configure-network-Debian.yml
@@ -21,7 +21,7 @@
lineinfile:
dest: /etc/modules
state: present
- create: yes
+ create: true
line: "8021q"
- name: Add modules
@@ -77,26 +77,26 @@
- name: Proxy configuration for apt
block:
- - name: Check that the /etc/apt/apt.conf exists
- stat:
- path: /etc/apt/apt.conf
- register: stat_result
+ - name: Check that the /etc/apt/apt.conf exists
+ stat:
+ path: /etc/apt/apt.conf
+ register: stat_result
- - name: Create /etc/apt/apt.conf, if it doesn't exist
- file:
- path: /etc/apt/apt.conf
- state: touch
- when: not stat_result.stat.exists
+ - name: Create /etc/apt/apt.conf, if it doesn't exist
+ file:
+ path: /etc/apt/apt.conf
+ state: touch
+ when: not stat_result.stat.exists
- - name: Add proxy setting to /etc/apt/apt.conf
- lineinfile:
- dest: /etc/apt/apt.conf
- state: present
- regexp: "^{{ item.name }}"
- line: "{{ item.name }} {{ item.value }} "
- with_items:
- - {name: 'Acquire::http::Proxy', value: '"{{ idf.proxy_settings.http_proxy }}";' }
- - {name: 'Acquire::https::Proxy', value: '"{{ idf.proxy_settings.https_proxy }}";' }
+ - name: Add proxy setting to /etc/apt/apt.conf
+ lineinfile:
+ dest: /etc/apt/apt.conf
+ state: present
+ regexp: "^{{ item.name }}"
+ line: "{{ item.name }} {{ item.value }} "
+ with_items:
+ - {name: 'Acquire::http::Proxy', value: '"{{ idf.proxy_settings.http_proxy }}";'}
+ - {name: 'Acquire::https::Proxy', value: '"{{ idf.proxy_settings.https_proxy }}";'}
when: idf.proxy_settings is defined
- name: Reboot the machine