diff options
author | Markos Chandras <mchandras@suse.de> | 2018-03-26 10:23:13 +0100 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2018-03-26 20:47:17 +0100 |
commit | 9e1d3d6e62abf5d0da26a296bcd235f37a54d9c6 (patch) | |
tree | fc2fb9d8056786b4543379977fb8e72de3f2125b /xci/installer/kubespray/playbooks | |
parent | 8f3c33c97acc5fc10a83e7cc7635da67e2460769 (diff) |
xci: playbooks: Fixes various ansible-lint warnings
In preparation for adding support for the 'ansible-lint' tool we fix
various problems in our playbooks to make the tool happy before we make
it mandatory.
Some of the problems that are fixed here are
- [ANSIBLE0011] All tasks should be named
- [ANSIBLE0012] Commands should not change things if nothing needs doing
- [ANSIBLE0013] Use shell only when shell functionality is required
- [ANSIBLE0010] Package installs should not use latest
installer-type:osa
deploy-scenario:os-nosdn-nofeature
Change-Id: I66c759d3932a414b81b2846393d2d98ce80c0b6d
Signed-off-by: Markos Chandras <mchandras@suse.de>
Diffstat (limited to 'xci/installer/kubespray/playbooks')
-rw-r--r-- | xci/installer/kubespray/playbooks/configure-opnfvhost.yml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/xci/installer/kubespray/playbooks/configure-opnfvhost.yml b/xci/installer/kubespray/playbooks/configure-opnfvhost.yml index 8166b0e5..eed814ba 100644 --- a/xci/installer/kubespray/playbooks/configure-opnfvhost.yml +++ b/xci/installer/kubespray/playbooks/configure-opnfvhost.yml @@ -31,7 +31,7 @@ delete: yes - name: generate SSH keys - shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N "" + command: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N "" args: creates: /root/.ssh/id_rsa - name: add id_rsa.pub to authorized_keys @@ -47,15 +47,19 @@ path: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory" state: absent - name: copy kubespray inventory directory - shell: "cp -rf {{ remote_xci_flavor_files }}/inventory \ + command: "cp -rf {{ remote_xci_flavor_files }}/inventory \ {{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory" + args: + creates: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory" - name: make sure kubespray/opnfv_inventory/group_vars/ exist file: path: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars" state: directory - name: copy k8s_cluster.yml - shell: "cp -rf {{ remote_xci_path }}/xci/installer/kubespray/files/k8s-cluster.yml \ + command: "cp -rf {{ remote_xci_path }}/xci/installer/kubespray/files/k8s-cluster.yml \ {{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars" + args: + creates: "{{ remote_xci_path }}/.cache/repos/kubespray/opnfv_inventory/group_vars" - name: Install required packages package: name: "{{ kube_require_packages[ansible_pkg_mgr] }}" @@ -82,3 +86,5 @@ tasks: - name: Append public keys to authorized_keys shell: "/bin/cat {{ ansible_env.HOME }}/.ssh/id_rsa.pub >> {{ xci_path }}/xci/files/authorized_keys" + args: + creates: "{{ xci_path }}/xci/files/authorized_keys" |