]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
lint: fix error [303,602,701,702]
authorDimitri Savineau <dsavinea@redhat.com>
Wed, 9 Oct 2019 19:39:04 +0000 (15:39 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 15 Oct 2019 08:07:52 +0000 (10:07 +0200)
 [303] mktemp used in place of tempfile module
 [602] Don't compare to empty string
 [701] No 'galaxy_info' found
 [702] Use 'galaxy_tags' rather than 'categories'

This patch also changes the ansible log_path value via the
ANSIBLE_LOG_PATH environment variable in the travis configuration to
avoid warnings.

[WARNING]: log file at /home/travis/ansible/ansible.log is not writeable
and we cannot create it, aborting

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
.travis.yml
roles/ceph-common/tasks/installs/configure_redhat_local_installation.yml
roles/ceph-dashboard/tasks/configure_dashboard.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-osd/tasks/main.yml
roles/ceph-prometheus/meta/main.yml
roles/ceph-rgw-loadbalancer/meta/main.yml

index 37e13911fa5cd0ca6d273f59c24eb3c826ab8185..4d25b525125f1a3023631835ba58bc28ee038bd7 100644 (file)
@@ -10,4 +10,4 @@ install:
 script:
   - if [[ -n $(grep --exclude-dir=.git -P "\xa0" -r .) ]]; then echo 'NBSP characters found'; exit 1; fi
   - pytest -vvvv library/ plugins/
-  - for i in $(ls -1 roles/); do ansible-lint -x 204 -v roles/$i/ ; done
+  - for i in $(ls -1 roles/); do ANSIBLE_LOG_PATH=/dev/null ansible-lint -x 204 -v roles/$i/ ; done
index 2dc0ddfbd4c2856fa25adf0db7b81457ea13a313..90c8cbfd88be0337425500537282e26e0a25f287 100644 (file)
@@ -6,20 +6,20 @@
   when: use_installer | bool
 
 - name: use mktemp to create name for rundep
-  command: "mktemp /tmp/rundep.XXXXXXXX"
+  tempfile:
+    path: /tmp
+    prefix: rundep.
   register: rundep_location
   when: use_installer | bool
 
 - name: copy rundep
   copy:
     src: "{{ ansible_dir }}/rundep"
-    dest: "{{ item }}"
-  with_items: "{{ (rundep_location|default({})).stdout_lines|default([]) }}"
+    dest: "{{ rundep_location.path }}"
   when: use_installer | bool
 
 - name: install ceph dependencies
-  script: "{{ ansible_dir }}/rundep_installer.sh {{ item }}"
-  with_items: "{{ (rundep_location|default({})).stdout_lines|default([]) }}"
+  script: "{{ ansible_dir }}/rundep_installer.sh {{ rundep_location.path }}"
   when: use_installer | bool
 
 - name: ensure rsync is installed
index 1df7fc5b2ff94e89c9450a5de1a9edc015c50e8f..25389a950fad965c09dee56e8e101d83f21c6640 100644 (file)
       changed_when: false
       delegate_to: "{{ groups[mon_group_name][0] }}"
       run_once: true
-      when: dashboard_rgw_api_admin_resource != ''
+      when: dashboard_rgw_api_admin_resource | length > 0
 
     - name: disable ssl verification for rgw
       command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} dashboard set-rgw-api-ssl-verify False"
index cda1f508c678eeb00d969891af2c9753c63b8ef7..9bd8e31e0ff222a5e7e8bfa6f498b2b0b9abc888 100644 (file)
@@ -29,7 +29,7 @@
             {{ item.pgp_num | default(item.pg_num) | default(osd_pool_default_pg_num) }}
             {{ 'replicated_rule' if not item.rule_name | default('replicated_rule') else item.rule_name | default('replicated_rule') }}
             {{ 1 if item.type|default(1) == 'replicated' else 3 if item.type|default(1) == 'erasure' else item.type|default(1) }}
-            {%- if (item.type | default("1") == '3' or item.type | default("1") == 'erasure') and item.erasure_profile != '' %}
+            {%- if (item.type | default("1") == '3' or item.type | default("1") == 'erasure') and item.erasure_profile | length > 0 %}
             {{ item.erasure_profile }}
             {%- endif %}
             {{ item.expected_num_objects | default('') }}
index e78df7320b392d73ab062b12d6c6e3f182f1a17d..d824435fe8b64cfcf28de1e9455470278a6187eb 100644 (file)
@@ -11,7 +11,7 @@
   register: ceph_health_raw
   run_once: true
   until: >
-    (ceph_health_raw.stdout != "") and (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
+    (ceph_health_raw.stdout | length > 0) and (ceph_health_raw.stdout | default('{}') | from_json)['state'] in ['leader', 'peon']
   retries: "{{ handler_health_mon_check_retries }}"
   delay: "{{ handler_health_mon_check_delay }}"
   changed_when: false
index f1caf321ec7b435fea4ecab55a98ddd4808daa2a..3993b327de43117e607867b89e8c5cf654c2e871 100644 (file)
@@ -19,7 +19,7 @@
   until: result is succeeded
   when:
     - containerized_deployment | bool
-    - ceph_osd_numactl_opts != ""
+    - ceph_osd_numactl_opts | length > 0
   tags: with_pkg
 
 - name: install lvm2
index e97ea337dc31f222dadf164690ea6fff15fab73c..fc0b1e280314f08c8733ace274830650905b4497 100644 (file)
@@ -1,3 +1,14 @@
 ---
-dependencies:
-  - role: ceph-defaults
+galaxy_info:
+  company: Red Hat
+  author: Boris Ranto
+  description: Configures Prometheus for Ceph Dashboard
+  license: Apache
+  min_ansible_version: 2.4
+  platforms:
+    - name: EL
+      versions:
+        - 7
+  galaxy_tags:
+    - system
+dependencies: []
index be9011759c4c6e59233bdb91696d6676f62d06b3..24c34b1a34695b93abfc2a949f910220b0f9d3bf 100644 (file)
@@ -8,6 +8,6 @@ galaxy_info:
     - name: EL
       versions:
         - 7
-  categories:
+  galaxy_tags:
     - system
 dependencies: []