Skip to content
Permalink
Browse files

Speed up existence tests by avoiding to take checksums etc.

[Ansible's `stat` module][1] by default computes the MD5 checksum of a
file, tries to get a file's extended attributes, and its MIME type --
turn all of this off since we're only checking for existence.

[1]: https://docs.ansible.com/ansible/latest/modules/stat_module.html
  • Loading branch information...
riccardomurri committed Mar 8, 2019
1 parent c1c43b7 commit d6f312e8cc5c20de5332da6edb7f92ccf9788347
@@ -34,6 +34,9 @@
- name: Does MDS keyring exist?
stat:
path: '{{_ceph_daemon_dir}}/keyring'
get_attributes: no
get_checksum: no
get_mime: no
register: ceph_mds_keyring_file
ignore_errors: yes

@@ -16,6 +16,9 @@
stat:
path: '/etc/cloud/cloud.cfg'
follow: yes
get_attributes: no
get_checksum: no
get_mime: no
register: cloud_cfg


@@ -10,7 +10,10 @@

- name: Is the EPEL repo already available? (RHEL/CentOS)
stat:
path='/etc/yum.repos.d/epel.repo'
path: '/etc/yum.repos.d/epel.repo'
get_attributes: no
get_checksum: no
get_mime: no
register: epel_repo_file


@@ -9,6 +9,9 @@
- name: Load info about the `ssh-keysign` executable
stat:
path: '{{ ssh_keysign_path }}'
get_attributes: no
get_checksum: no
get_mime: no
register: ssh_keysign


@@ -10,4 +10,7 @@
# we only need to check for the first device node to see if any are present
stat:
path: '/dev/nvidia0'
get_attributes: no
get_checksum: no
get_mime: no
register: '{{ save_result_to|default("_cuda_check_devices") }}'
@@ -32,6 +32,9 @@
stat:
path: '/etc/apache2/conf-available'
follow: no
get_attributes: no
get_checksum: no
get_mime: no
register: apache_conf_available_d

- name: Configure Ganglia web endpoint in /etc/apache2/conf-available (Debian/Ubuntu)
@@ -51,6 +54,9 @@
stat:
path: '/etc/apache2/conf.d'
follow: no
get_attributes: no
get_checksum: no
get_mime: no
register: apache_conf_d

- name: Configure Ganglia web endpoint in /etc/apache2/conf.d (Debian/Ubuntu)
@@ -7,21 +7,27 @@
- python
- pyspark
stat:
path=/usr/bin/pyspark
path: /usr/bin/pyspark
get_attributes: no
get_checksum: no
get_mime: no
register: pyspark_exe_path


- name: Check if the Python executable {{python_exe}} is installed
tags:
- jupyter
- kernels
- python
- pyspark
stat:
path='{{python_exe}}'
path: '{{python_exe}}'
get_attributes: no
get_checksum: no
get_mime: no
register: python_exe_path


- name: Determine version of Python interpreter {{python_exe}}
tags:
- jupyter
@@ -32,8 +38,8 @@
'{{python_exe}} -c "import sys; sys.stdout.write(str(sys.version_info.major))"'
register: python_version
when: python_exe_path.stat.exists


- block:
- name: Install PySpark{{python_version.stdout}} kernel (directory)
file:
@@ -57,4 +63,3 @@
- kernels
- python
- pyspark

@@ -6,7 +6,10 @@
- kernels
- python
stat:
path='{{python_exe}}'
path: '{{python_exe}}'
get_attributes: no
get_checksum: no
get_mime: no
register: python_exe_path


@@ -3,6 +3,9 @@
- name: Check that the /etc/kubernetes/kubelet.conf exists
stat:
path: /etc/kubernetes/kubelet.conf
get_attributes: no
get_checksum: no
get_mime: no
register: kubelet_presence

- name: Join Kubernetes cluster
@@ -47,6 +47,9 @@
- name: PostgreSQL | Check whether the postgres data directory is initialized
stat:
path: "{{ postgresql_data_directory }}/PG_VERSION"
get_attributes: no
get_checksum: no
get_mime: no
when: ansible_os_family == "RedHat" and not postgresql_cluster_reset
register: pgdata_dir_initialized

@@ -7,8 +7,11 @@

- name: Check if SLURM work directory {{path}} exist
stat:
path='{{path}}'
follow=yes
path: '{{path}}'
follow: yes
get_attributes: no
get_checksum: no
get_mime: no
register: p

- name: Create work directory {{path}}
@@ -53,6 +53,9 @@
- name: Check if swap accouting is enabled (may fail!)
stat:
path: '/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes'
get_attributes: no
get_checksum: no
get_mime: no
register: _memsw_limit


@@ -19,8 +19,11 @@

- name: Check if Py4J version-independent `.zip` archive exist
stat:
path='/usr/lib/spark/python/lib/py4j-src.zip'
follow=no
path: '/usr/lib/spark/python/lib/py4j-src.zip'
follow: no
get_attributes: no
get_checksum: no
get_mime: no
register: p
tags:
- hadoop

0 comments on commit d6f312e

Please sign in to comment.
You can’t perform that action at this time.