From 9e38736b93a6b737ecb53d1f41dadf45cbb22c1c Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Fri, 25 Oct 2019 00:19:07 +0200 Subject: Various stuff to pre-configure compute nodes --- roles/ands_scripts/tasks/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 roles/ands_scripts/tasks/main.yml (limited to 'roles/ands_scripts/tasks') diff --git a/roles/ands_scripts/tasks/main.yml b/roles/ands_scripts/tasks/main.yml new file mode 100644 index 0000000..048b0da --- /dev/null +++ b/roles/ands_scripts/tasks/main.yml @@ -0,0 +1,29 @@ +#- name: Install monitoring applications +# package: name={{item}} state=present +# with_items: +# - sysstat + +- name: Create scripts directory + file: path="{{ ands_script_path }}" state=directory + +- name: "Deploy scripts" + copy: src="{{ item | quote }}" dest="{{ ands_script_path }}/{{ item | basename | quote }}" owner=root group=root mode=0755 + with_fileglob: + - "{{ role_path }}/templates/all/scripts/*.sh" + - "{{ role_path }}/templates/{{ inventory_hostname }}/scripts/*.sh" + +- name: "Deploy script templates" + template: src="{{ item | quote }}" dest="{{ ands_script_path }}/{{ script_name }}" owner=root group=root mode=0755 + vars: + script_name: "{{ item | basename | regex_replace('\\.j2','') }}" + with_fileglob: + - "{{ role_path }}/templates/all/scripts/*.j2" + - "{{ role_path }}/templates/{{ inventory_hostname }}/scripts/*.j2" + +- name: "Deploy cron jobs" + template: src="{{ item | quote }}" dest="/etc/cron.d/{{ cron_name }}" owner=root group=root mode=0644 + vars: + cron_name: "{{ item | basename | regex_replace('\\.j2','') }}" + with_fileglob: + - "{{ role_path }}/templates/all/cron/*.j2" + - "{{ role_path }}/templates/{{ inventory_hostname }}/cron/*.j2" -- cgit v1.2.3