Code Monkey home page Code Monkey logo

ansible-clamav_mirror's Introduction

clamav_mirror

Ansible role which helps to install and configure ClamAV mirror.

The configuration of the role is done in such way that it should not be necessary to change the role for any kind of configuration. All can be done either by changing role parameters or by declaring completely new configuration as a variable. That makes this role absolutely universal. See the examples below for more details.

Please report any issues or send PR.

Examples

---

- name: ClamAV mirror server
  hosts: clamav-server
  vars:
    # Use more local DB server (e.g from UK)
    clamav_mirror_script_db: db.uk.clamav.net
    # Create new location for the DB files
    nginx_vhost_config__default__custom:
      - "location /db":
        - alias {{ clamav_mirror_script_mirrordir }}
        - autoindex on
  roles:
    - clamav_mirror
    - nginx

- name: ClamAV client
  hosts: clamav-client
  vars:
    # Point freshclam to our mirror server
    clamav_freshclam_database_mirror:
      - 192.168.151.10
    clamav_freshclam_config__custom:
      DatabaseCustomURL:
        # Point to the /db location
        # (Freshclam cannot handle HTTPS!)
        - http://192.168.151.10/db/bytecode.cvd
        - http://192.168.151.10/db/daily.cvd
        - http://192.168.151.10/db/main.cvd
  roles:
    - clamav

Role variables

# Mirror script dependencies:
clamav_mirror_script_deps:
  - clamav
  - python-dns

# File name of the mirror script
# (taken from: https://github.com/vrtadmin/clamav-faq/mirrors/)
clamav_mirror_script: clamavmirror.py

# ClamAV DB mirror
clamav_mirror_script_db: database.clamav.net

# ClamAV TXT record server
clamav_mirror_script_txt: current.cvd.clamav.net

# All the *dir variables bellow can also be accompanied with
# *dir_{mode,owner,group} variables which allow to configure the directory
# owner, group and mode.
# (e.g "clamav_mirror_script_mirrordir_owner: nginx" will set the nginx user as
# the owner)

# Directory where to store the script
clamav_mirror_script_bindir: /usr/local/bin

# Directory where to store intermediate downloads
clamav_mirror_script_workdir: /var/spool/clamav_mirror

# Directory where to store the mirrored files
clamav_mirror_script_mirrordir: /srv/www/clamav_mirror

# Directory where to store the lockfile
clamav_mirror_script_lockdir: /var/lock/subsys

# User which should own the mirrored files
clamav_mirror_script_user: nginx

# Group which should own the mirrored files
clamav_mirror_script_group: nginx

# Crontab time settings
clamav_mirror_cron_minute: "*/30"
clamav_mirror_cron_hour: "*"
clamav_mirror_cron_weekday: "*"

# Cron job prefix (e.g. for specifying http_proxy)
clamav_mirror_cron_job_prefix: ""

# Crontab job
clamav_mirror_cron_job: >-
  {{ clamav_mirror_cron_job_prefix }}
  {{ clamav_mirror_script_bindir }}/{{ clamav_mirror_script }}
  -w {{ clamav_mirror_script_workdir }}
  -d {{ clamav_mirror_script_mirrordir }}
  -l {{ clamav_mirror_script_lockdir }}
  -r {{ clamav_mirror_script_txt }}
  -a {{ clamav_mirror_script_db }}
  -u {{ clamav_mirror_script_user }}
  -g {{ clamav_mirror_script_group }}

# Whether to run the mirroring script as a part of this role for the first time
clamav_mirror_init: yes

Dependencies

License

MIT

Author

Jiri Tyr

ansible-clamav_mirror's People

Contributors

jtyr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.