Skip to content
Snippets Groups Projects
main.yml 1.36 KiB
Newer Older
  • Learn to ignore specific revisions
  • Florian Pritz's avatar
    Florian Pritz committed
    ---
    
    # make and gcc are required for sa-compile
    - name: install spampd and dependencies
    
      pacman: name=spampd,make,gcc,razor state=present
    
    Florian Pritz's avatar
    Florian Pritz committed
    
    - name: install sa-update.sh
    
      copy: src=sa-update.sh dest=/usr/local/bin/sa-update.sh owner=root group=root mode=0755
    
      notify:
        - restart sa-update
    
    Florian Pritz's avatar
    Florian Pritz committed
    
    - name: install support files
    
      copy: src={{ item }} dest=/etc/mail/spamassassin/{{ item }} owner=root group=root mode=0644
    
    Florian Pritz's avatar
    Florian Pritz committed
      with_items:
        - update-gpgkeys
        - update-channels
        - yerp.gpg.key
        - zmi.gpg.key
    
    - name: install systemd timers
    
      copy: src={{ item }} dest=/etc/systemd/system/{{ item }} owner=root group=root mode=0644
    
    Florian Pritz's avatar
    Florian Pritz committed
      with_items:
        - sa-update.timer
        - sa-update.service
      notify:
        - systemd daemon reload
    
    
    - name: create sa-update keyring directory
      file: path=/etc/mail/spamassassin/sa-update-keys mode=700 owner=root group=root state=directory
    
    
    Florian Pritz's avatar
    Florian Pritz committed
    - name: add gpg keys to SA keyring
      command: /usr/bin/vendor_perl/sa-update --import "/etc/mail/spamassassin/{{item}}"
      with_items:
        - yerp.gpg.key
        - zmi.gpg.key
    
    
    - name: install SA config
      template: src=local.cf.j2 dest=/etc/mail/spamassassin/local.cf owner=root group=root mode=0644
      notify:
        restart spampd
    
    
    Florian Pritz's avatar
    Florian Pritz committed
    - name: activate systemd timers
      service: name={{ item }} enabled=yes state=started
      with_items:
        sa-update.timer
    
    - name: start spampd
      service: name=spampd enabled=yes state=started