You've already forked ansible-role-csf
feat: Initial Project 🎉
This commit is contained in:
44
tasks/install.yml
Normal file
44
tasks/install.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
# 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
|
||||
Reference in New Issue
Block a user