You've already forked ansible-role-csf
45 lines
1021 B
YAML
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
|