From Sharp Leech, 1 Month ago, written in Plain Text.
Embed
  1. - name: configure ispc server
  2.   hosts: ispc.pve
  3.   become: true
  4.   become_method: sudo
  5.   roles:
  6.   vars_files:
  7.     - ../vars/credentials.yml
  8.     - ../vars/ips.yml
  9.   vars:
  10.     - my_networks:
  11.       - "127.0.0.0/8"
  12.       - "[::1]/128"
  13.       - "10.0.0.0/24"
  14.       - "195.201.240.91/32"
  15.       - "195.201.240.90/32"
  16.       - "[2a01:4f8:231:96::]/64"
  17.       - "[2a01:4f8:231:96::1:0]/112"
  18.   handlers:
  19.     - import_tasks: ../handlers/handlers.yml
  20.   tasks:
  21.     - name: install packages
  22.       apt:
  23.         update_cache: true
  24.         name:
  25.           - php5.6-memcached
  26.           - php7.0-memcached
  27.           - php7.1-memcached
  28.           - php7.2-memcached
  29.           - php7.3-memcached
  30.           - php7.4-memcached
  31.           - php8.0-memcached
  32.           - php8.1-memcached
  33.     - name: set mynetworks in postfix
  34.       replace:
  35.         dest: /etc/postfix/main.cf
  36.         regexp: "^mynetworks = .*"
  37.         replace: "mynetworks = {{ my_networks | join(' ') }}"
  38.       notify: reload postfix
  39.     - name: set mynetworks in rspamd
  40.       copy:
  41.         dest: /etc/rspamd/local.d/local_networks.inc
  42.         content: "{{ my_networks | join('\n') | replace('[', '') | replace(']', '') }}"
  43.       notify: reload rspamd
  44.     - name: set reject in rspamd
  45.       copy:
  46.         dest: /etc/rspamd/override.d/actions.conf
  47.         content: "reject = 100;"
  48.       notify: reload rspamd
  49.     - import_tasks: ../includes/user_root_ispc.yml
  50.     - import_tasks: ../includes/vimrc.yml
  51.