From e0d90df027ec3e602313b21007f2d37a245272ec Mon Sep 17 00:00:00 2001 From: Aleksey Zalesov Date: Sat, 24 Feb 2018 14:16:01 +0300 Subject: [PATCH] Name the unnamed tasks in Ansible playbooks Ansible-linter requires all the tasks in the playbook to be named. Reference to the linter rule: [ANSIBLE0011] All tasks should be named --- roles/explorer/tasks/main.yml | 6 ++++-- roles/moc/tasks/main.yml | 9 +++++++-- roles/netstat/tasks/main.yml | 3 ++- roles/nginx/tasks/main.yml | 3 ++- roles/poa-netstats/tasks/main.yml | 3 ++- roles/preconf/tasks/vars.yml | 18 +++++++++++++----- roles/usermanager/tasks/main.yml | 3 ++- roles/validator/tasks/main.yml | 17 ++++++++++++++--- 8 files changed, 46 insertions(+), 16 deletions(-) diff --git a/roles/explorer/tasks/main.yml b/roles/explorer/tasks/main.yml index bcda48e..2409194 100644 --- a/roles/explorer/tasks/main.yml +++ b/roles/explorer/tasks/main.yml @@ -26,7 +26,8 @@ with_items: - node.toml -- git: +- name: Clone poanetworks/chain-explorer repo from GitHub + git: repo: "https://github.com/{{ MAIN_REPO_FETCH }}/chain-explorer" dest: "{{ home }}/chain-explorer" version: "acee07c" @@ -36,7 +37,8 @@ notify: - restart poa-chain-explorer -- file: path={{ home }}/chain-explorer owner={{ username }} group={{ username }} recurse=yes +- name: Set group and owner on the chain-explorer directory + file: path={{ home }}/chain-explorer owner={{ username }} group={{ username }} recurse=yes - name: install npm chain_explorer npm: diff --git a/roles/moc/tasks/main.yml b/roles/moc/tasks/main.yml index 7b13d98..d53ab24 100644 --- a/roles/moc/tasks/main.yml +++ b/roles/moc/tasks/main.yml @@ -34,9 +34,14 @@ content: "{{ MOC_KEYFILE }}" dest: "{{ home }}/parity_data/keys/{{ GENESIS_NETWORK_NAME }}/{{ username }}.key" -- git: repo=https://github.com/{{ MAIN_REPO_FETCH }}/poa-scripts-moc dest={{ home }}/poa-scripts-moc version={{ SCRIPTS_MOC_BRANCH }} +- name: Clone poanetworks/poa-scripts-moc repo from GitHub + git: + repo: "https://github.com/{{ MAIN_REPO_FETCH }}/poa-scripts-moc" + dest: "{{ home }}/poa-scripts-moc" + version: "{{ SCRIPTS_MOC_BRANCH }}" -- file: path={{ home }}/poa-scripts-moc owner={{ username }} group={{ username }} recurse=yes +- name: Change owner and group of poa-scripts-moc file + file: path={{ home }}/poa-scripts-moc owner={{ username }} group={{ username }} recurse=yes - name: install npm initial_keys_script npm: diff --git a/roles/netstat/tasks/main.yml b/roles/netstat/tasks/main.yml index 64973aa..028d307 100644 --- a/roles/netstat/tasks/main.yml +++ b/roles/netstat/tasks/main.yml @@ -13,7 +13,8 @@ dest: "{{ home }}/eth-netstats" version: "cb431d6" -- file: path={{ home }}/eth-netstats owner={{ username }} group={{ username }} recurse=yes +- name: Set owner and group on eth-netstats files + file: path={{ home }}/eth-netstats owner={{ username }} group={{ username }} recurse=yes - name: install npm netstats npm: diff --git a/roles/nginx/tasks/main.yml b/roles/nginx/tasks/main.yml index 5ffd286..39ed7cc 100644 --- a/roles/nginx/tasks/main.yml +++ b/roles/nginx/tasks/main.yml @@ -3,7 +3,8 @@ apt: name=nginx state=present tags: nginx -- file: path=/etc/nginx/ssl state=directory mode=0755 +- name: Create directory for nginx SSL certificates + file: path=/etc/nginx/ssl state=directory mode=0755 tags: nginx - name: Check certificate file diff --git a/roles/poa-netstats/tasks/main.yml b/roles/poa-netstats/tasks/main.yml index af3a2ce..258eda6 100644 --- a/roles/poa-netstats/tasks/main.yml +++ b/roles/poa-netstats/tasks/main.yml @@ -26,7 +26,8 @@ notify: - restart poa-netstats -- file: path={{ home }}/eth-net-intelligence-api owner={{ username }} group={{ username }} recurse=yes +- name: Change owner and group of eth-net-intelligence-api files + file: path={{ home }}/eth-net-intelligence-api owner={{ username }} group={{ username }} recurse=yes - name: install npm netstats npm: diff --git a/roles/preconf/tasks/vars.yml b/roles/preconf/tasks/vars.yml index a11160d..10e6fdb 100644 --- a/roles/preconf/tasks/vars.yml +++ b/roles/preconf/tasks/vars.yml @@ -1,7 +1,15 @@ --- -- sysctl: name=vm.swappiness value=10 state=present -- sysctl: name=vm.vfs_cache_pressure value=50 state=present -- sysctl: name=net.core.somaxconn value=1000 state=present +- name: Set vm.swappiness system parameter + sysctl: name=vm.swappiness value=10 state=present -- lineinfile: dest=/etc/security/limits.conf line="* soft nofile 100000" state=present -- lineinfile: dest=/etc/security/limits.conf line="* hard nofile 100000" state=present +- name: Set vm.vfs_cache_pressure system parameter + sysctl: name=vm.vfs_cache_pressure value=50 state=present + +- name: Set net.core.somaxconn system parameter + sysctl: name=net.core.somaxconn value=1000 state=present + +- name: Set nofile soft limit + lineinfile: dest=/etc/security/limits.conf line="* soft nofile 100000" state=present + +- name: Set nofile hard limit + lineinfile: dest=/etc/security/limits.conf line="* hard nofile 100000" state=present diff --git a/roles/usermanager/tasks/main.yml b/roles/usermanager/tasks/main.yml index 42812b4..e0d0ced 100644 --- a/roles/usermanager/tasks/main.yml +++ b/roles/usermanager/tasks/main.yml @@ -1,5 +1,6 @@ --- -- user: name={{ item.name }} groups={{ item.addgroups | default('') }} shell=/bin/bash append=yes +- name: Create users + user: name={{ item.name }} groups={{ item.addgroups | default('') }} shell=/bin/bash append=yes with_items: "{{ users }}" - include_tasks: nested_authorized_key.yml diff --git a/roles/validator/tasks/main.yml b/roles/validator/tasks/main.yml index 9780f70..8ca23ba 100644 --- a/roles/validator/tasks/main.yml +++ b/roles/validator/tasks/main.yml @@ -34,11 +34,22 @@ content: "{{ MINING_KEYFILE }}" dest: "{{ home }}/parity_data/keys/{{ GENESIS_NETWORK_NAME }}/validator.key.{{ MINING_ADDRESS }}" -- git: repo=https://github.com/{{ MAIN_REPO_FETCH }}/poa-scripts-validator dest={{ home }}/poa-scripts-validator version={{ SCRIPTS_VALIDATOR_BRANCH }} +- name: Clone poanetworks/poa-scripts-validator repo from GitHub + git: + repo: "https://github.com/{{ MAIN_REPO_FETCH }}/poa-scripts-validator" + dest: "{{ home }}/poa-scripts-validator" + version: "{{ SCRIPTS_VALIDATOR_BRANCH }}" -- file: src="{{ home }}/node.toml" dest="{{ home }}/poa-scripts-validator/node.toml" owner="{{ username }}" group="{{ username }}" state=link +- name: Link node.toml file + file: + src: "{{ home }}/node.toml" + dest: "{{ home }}/poa-scripts-validator/node.toml" + owner: "{{ username }}" + group: "{{ username }}" + state: link -- file: path={{ home }}/poa-scripts-validator owner={{ username }} group={{ username }} recurse=yes +- name: Set up owner and group on poa-scripts-validator files + file: path={{ home }}/poa-scripts-validator owner={{ username }} group={{ username }} recurse=yes - name: install npm transferRewardToPayoutKey npm: