Linux/Ansible

From Wiki
< Linux
Revision as of 14:42, 11 November 2018 by Marcluer (talk | contribs)

/srv/ansible-config/roles/<role-name>/tasks/main.yml

  • apt
- name: update apt
  apt:
    update_cache: yes
    cache_valid_time: 3600

- name: install apt packages
  apt:
    name: ["aptitude", "git", "mc", "nmap"]
  • copy
- name: copy openvpn client config files
  copy:
    src: ../files/
    dest: /etc/openvpn

- name: enable fail2ban config
  copy:
    src: /etc/fail2ban/fail2ban.conf
    dest: /etc/fail2ban/fail2ban.local
    remote_src: yes
  • systemd
- name: reload systemd config
  systemd:
    daemon_reload: yes

- name: restart fail2ban
  systemd:
    name: fail2ban
    state: restarted