Files
ansible-role-csf/tasks/install.yml
Aaron Guise d4366fef2a
Some checks failed
CI / lint (push) Failing after 2m15s
CI / release (push) Has been skipped
CI / notify (push) Has been skipped
feat: Initial Project 🎉
2024-08-20 11:11:35 +12:00

45 lines
1021 B
YAML

---
# csf/tasks/install.yml
- name: install required packages
package:
name: '{{ item }}'
state: present
update_cache: yes
with_flattened:
- '{{ csf_required_packages }}'
- '{{ csf_required_packages_dist }}'
tags:
- packages
- name: check /usr/sbin/csf file
stat:
path: /usr/sbin/csf
register: csf_sbin_file
- name: download csf.tgz
get_url:
url: 'https://download.configserver.com/csf.tgz'
dest: '{{ csf_tmp_dir }}/csf.tgz'
checksum: 'sha256:https://www.configserver.com/checksums.txt'
when: not csf_sbin_file.stat.exists
tags:
- download
- name: unpack csf.tgz
unarchive: # noqa 208
src: '{{ csf_tmp_dir }}/csf.tgz'
dest: '{{ csf_tmp_dir }}'
remote_src: yes
creates: '{{ csf_tmp_dir }}/csf/install.sh'
when: not csf_sbin_file.stat.exists
- name: run CSF installer
command: sh install.sh
args:
chdir: '{{ csf_tmp_dir }}/csf'
creates: /etc/csf/csf.conf
when: not csf_sbin_file.stat.exists
notify:
- run csftest.pl