Files
ansible-role-csf/tasks/install.yml

45 lines
1022 B
YAML
Raw Normal View History

2024-08-20 11:11:35 +12:00
---
# csf/tasks/install.yml
- name: install required packages
package:
name: '{{ item }}'
state: present
2024-08-20 11:32:48 +12:00
update_cache: true
2024-08-20 11:11:35 +12:00
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:
2024-08-20 11:32:48 +12:00
url: 'https://download.configserver.com/csf.tgz'
2024-08-20 11:11:35 +12:00
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
2024-08-20 11:32:48 +12:00
unarchive: # noqa 208
src: '{{ csf_tmp_dir }}/csf.tgz'
2024-08-20 11:11:35 +12:00
dest: '{{ csf_tmp_dir }}'
2024-08-20 11:32:48 +12:00
remote_src: true
2024-08-20 11:11:35 +12:00
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