From 9e1d3d6e62abf5d0da26a296bcd235f37a54d9c6 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 26 Mar 2018 10:23:13 +0100 Subject: 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 --- xci/installer/kubespray/playbooks/configure-opnfvhost.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'xci/installer/kubespray/playbooks/configure-opnfvhost.yml') 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" -- cgit 1.2.3-korg