]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
lint: do not use local_action
authorSébastien Han <seb@redhat.com>
Thu, 1 Nov 2018 11:50:31 +0000 (12:50 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Thu, 8 Nov 2018 10:22:02 +0000 (10:22 +0000)
Use delegate_to: localhost instead.

Signed-off-by: Sébastien Han <seb@redhat.com>
12 files changed:
roles/ceph-common/tasks/facts_mon_fsid.yml
roles/ceph-config/tasks/main.yml
roles/ceph-defaults/tasks/facts.yml
roles/ceph-docker-common/tasks/fetch_image.yml
roles/ceph-docker-common/tasks/stat_ceph_files.yml
roles/ceph-iscsi-gw/tasks/deploy_ssl_keys.yml
roles/ceph-mds/tasks/containerized.yml
roles/ceph-mon/tasks/deploy_monitors.yml
roles/ceph-mon/tasks/docker/copy_configs.yml
roles/ceph-nfs/tasks/pre_requisite_container.yml
roles/ceph-osd/tasks/copy_configs.yml
roles/ceph-rbd-mirror/tasks/docker/copy_configs.yml

index 157c384f36c7dce55c28f62d6229e006aec73b68..a5023caba5f1cf088e4aea460d9537159d10de27 100644 (file)
@@ -30,9 +30,8 @@
     - test_initial_monitor_keyring.rc != 0
 
 - name: write initial mon keyring in {{ fetch_directory }}/monitor_keyring.conf if it doesn't exist
-  local_action:
-    module: shell
-      echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf
+  shell: "echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf"
+  delegate_to: localhost
   become: false
   when:
     - test_initial_monitor_keyring.rc == 0
index 8130c922e0aee5363b0478232a42f43c4dedaacd..0591fda7ef22193fe8544f111ae138405d181587 100644 (file)
   - name: "ensure fetch directory exists"
     run_once: true
     become: false
-    local_action:
-      module: file
+    file:
       path: "{{ fetch_directory }}/{{ fsid }}/etc/ceph"
       state: directory
       mode: "0755"
+    delegate_to: localhost
     when:
       - ceph_conf_local
 
   - name: "generate {{ cluster }}.conf configuration file locally"
-    local_action: config_template
+    config_template:
     become: false
     run_once: true
+    delegate_to: localhost
     args:
       src: "ceph.conf.j2"
       dest: "{{ fetch_directory }}/{{ fsid }}/etc/ceph/{{ cluster }}.conf"
 # we are not population kv_store with default ceph.conf AND there at least 1 nfs in nfs group AND host is the first nfs
 - block:
   - name: create a local fetch directory if it does not exist
-    local_action:
-      module: file
+    file:
       path: "{{ fetch_directory }}"
       state: directory
+    delegate_to: localhost
     changed_when: false
     become: false
     run_once: true
             and (inventory_hostname == groups.get(nfs_group_name, [])[0])))
 
   - name: generate cluster uuid
-    local_action:
-      module: shell
-        python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+    shell: python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+    args:
       creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf"
+    delegate_to: localhost
     register: cluster_uuid
     become: false
     when:
       - generate_fsid
 
   - name: read cluster uuid if it already exists
-    local_action:
-      module: command
-        cat {{ fetch_directory }}/ceph_cluster_uuid.conf
+    command: "cat {{ fetch_directory }}/ceph_cluster_uuid.conf"
+    args:
       removes: "{{ fetch_directory }}/ceph_cluster_uuid.conf"
+    delegate_to: localhost
     changed_when: false
     register: cluster_uuid
     check_mode: no
index 1686802246f13d239dc2b3acf452bdff3e399d85..ef8c5f94bfe2060cc01c8c1694b42a1a0c0644e3 100644 (file)
@@ -45,9 +45,9 @@
 
 # We want this check to be run only on the first node
 - name: check if {{ fetch_directory }} directory exists
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/monitor_keyring.conf"
+  delegate_to: localhost
   become: false
   register: monitor_keyring_conf
   run_once: true
     - rolling_update or groups.get(mon_group_name, []) | length == 0
 
 - name: create a local fetch directory if it does not exist
-  local_action:
-    module: file
+  file:
     path: "{{ fetch_directory }}"
     state: directory
+  delegate_to: localhost
   changed_when: false
   become: false
   when:
     ceph_release: "{{ ceph_stable_release }}"
 
 - name: generate cluster fsid
-  local_action:
-    module: shell
-      python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+  shell: python -c 'import uuid; print(str(uuid.uuid4()))' | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+  args:
     creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf"
   register: cluster_uuid
+  delegate_to: localhost
   become: false
   when:
     - generate_fsid
     - ceph_current_status.fsid is undefined
 
 - name: reuse cluster fsid when cluster is already running
-  local_action:
-    module: shell
-      echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+  shell: echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf
+  args:
     creates: "{{ fetch_directory }}/ceph_cluster_uuid.conf"
+  delegate_to: localhost
   become: false
   when:
     - ceph_current_status.fsid is defined
 
 - name: read cluster fsid if it already exists
-  local_action:
-    module: command
-      cat {{ fetch_directory }}/ceph_cluster_uuid.conf
+  command: cat {{ fetch_directory }}/ceph_cluster_uuid.conf
+  args:
     removes: "{{ fetch_directory }}/ceph_cluster_uuid.conf"
+  delegate_to: localhost
   changed_when: false
   register: cluster_uuid
   become: false
index 4f3e5c8c86cae0de59fe708e739090bb571f865a..1b634745790495d41ec89cd78123785f02f05b1f 100644 (file)
     - ceph_nfs_image_repodigest_before_pulling != image_repodigest_after_pulling
 
 - name: export local ceph dev image
-  local_action:
-    module: command
-      docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar" "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
+  command: >
+    docker save -o "/tmp/{{ ceph_docker_username }}-{{ ceph_docker_imagename }}-{{ ceph_docker_image_tag }}.tar"
+    "{{ ceph_docker_username }}/{{ ceph_docker_imagename }}:{{ ceph_docker_image_tag }}"
+  delegate_to: localhost
   when:
     - (ceph_docker_dev_image is defined and ceph_docker_dev_image)
   run_once: true
index 16f4d62ead7ee5aa2290900d8fe64237ed7ccfc0..aa732cc1293e2593adbe552f2268c46134a248fe 100644 (file)
@@ -28,9 +28,9 @@
   when: groups.get(mgr_group_name, []) | length > 0
 
 - name: stat for ceph config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false
index f4979f2cbc839309d9e3b63752428918a50a2b9a..afd474db524694a8de19e8608c684ff5c48a0d5f 100644 (file)
@@ -8,9 +8,9 @@
       - "iscsi-gateway-pub.key"
 
 - name: stat for crt file(s)
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ crt_files }}"
   changed_when: false
   failed_when: false
   register: crt_files_exist
 
 - name: create ssl crt/key files
-  local_action:
-    module: command openssl req -newkey rsa:2048 -nodes -keyout {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.key -x509 -days 365 -out {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.crt -subj "/C=US/ST=./L=./O=RedHat/OU=Linux/CN={{ ansible_hostname }}"
+  command: >
+    openssl req -newkey rsa:2048 -nodes -keyout {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.key
+     -x509 -days 365 -out {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.crt
+     -subj "/C=US/ST=./L=./O=RedHat/OU=Linux/CN={{ ansible_hostname }}"
+  delegate_to: localhost
   run_once: True
   with_items: "{{ crt_files_exist.results }}"
   when:
     - item.stat.exists == false
 
 - name: create pem
-  local_action:
-    module: shell cat {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.crt {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.key > {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.pem
+  shell: >
+    cat {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.crt
+    {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.key > {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.pem
+  delegate_to: localhost
   run_once: True
   register: pem
   with_items: "{{ crt_files_exist.results }}"
     - item.stat.exists == false
 
 - name: create public key from pem
-  local_action:
-    module: shell openssl x509 -inform pem -in {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.pem -pubkey -noout > {{ fetch_directory }}/{{ fsid }}/iscsi-gateway-pub.key
+  shell: >
+    openssl x509 -inform pem -in {{ fetch_directory }}/{{ fsid }}/iscsi-gateway.pem
+    -pubkey -noout > {{ fetch_directory }}/{{ fsid }}/iscsi-gateway-pub.key
+  delegate_to: localhost
   run_once: True
   when:
     - pem.changed
index 55b34fbd5a92a3f404266256714902afc7d48ffd..9fc286581c34a1cc0baadf2eff83b425ae6ecc2a 100644 (file)
@@ -22,9 +22,9 @@
     - copy_admin_key
 
 - name: stat for ceph config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false
index d792db1b46d3f67469a081e539eab4ad35834d85..04b29ddd97bb2f9664e67cc06eae143ffbec978e 100644 (file)
@@ -1,18 +1,22 @@
 ---
 - name: generate monitor initial keyring
-  local_action:
-    module: shell
-      python -c "import os ; import struct ; import time; import base64 ; key = os.urandom(16) ; header = struct.pack('<hiih',1,int(time.time()),0,len(key)) ; print(base64.b64encode(header + key).decode())" | tee {{ fetch_directory }}/monitor_keyring.conf
+  shell: >
+    python -c "import os ; import struct ;
+    import time; import base64 ; key = os.urandom(16) ;
+    header = struct.pack('<hiih',1,int(time.time()),0,len(key)) ;
+    print(base64.b64encode(header + key).decode())" | tee {{ fetch_directory }}/monitor_keyring.conf
+  args:
     creates: "{{ fetch_directory }}/monitor_keyring.conf"
+  delegate_to: localhost
   register: monitor_keyring
   become: false
   when: cephx
 
 - name: read monitor initial keyring if it already exists
-  local_action:
-    module: command
-      cat {{ fetch_directory }}/monitor_keyring.conf
+  command: "cat {{ fetch_directory }}/monitor_keyring.conf"
+  args:
     removes: "{{ fetch_directory }}/monitor_keyring.conf"
+  delegate_to: localhost
   changed_when: false
   register: monitor_keyring
   become: false
index bcf0d3294c3a33cf9d811e7c573d556fd38e066e..304d0437153c51966bfbb66429c9f34a69df70d2 100644 (file)
@@ -10,9 +10,9 @@
       - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring
 
 - name: stat for ceph config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false
index ab4d27f6e752a91c16ed7f9ab0674b3dad58dab4..3fffdd3873721a61a27535c45f0607648cf3303b 100644 (file)
@@ -18,9 +18,9 @@
     - copy_admin_key
 
 - name: stat for config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false
index 593e846ce06b400a91ce6a9f714f2904cbbc877b..bef570b0effef31d98e47ea5d83149c499608c8f 100644 (file)
     - copy_admin_key
 
 - name: wait for ceph.conf and keys
-  local_action:
-    module: wait_for
+  wait_for:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   become: false
   with_items: "{{ ceph_config_keys }}"
 
 - name: stat for ceph config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false
index 3e4cef665057d470e640d6cc98abe1d8629f9410..7cd7b94b1ea1c338971b4adea8681c3ddd8ac019 100644 (file)
@@ -6,9 +6,9 @@
       - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring
 
 - name: stat for ceph config and keys
-  local_action:
-    module: stat
+  stat:
     path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
+  delegate_to: localhost
   with_items: "{{ ceph_config_keys }}"
   changed_when: false
   become: false