Skip to content
Snippets Groups Projects
configure.yml 1.71 KiB
Newer Older
  • Learn to ignore specific revisions
  • jurgenhaas's avatar
    jurgenhaas committed
    ---
    # file: roles/haproxy/tasks/configure.yml
    
    - name: "Proxy | Install SSL certificates"
    
      copy: src={{inventory_dir}}/files/ssl/{{item.file}}
    
    jurgenhaas's avatar
    jurgenhaas committed
            dest=/etc/haproxy/certs
    
      with_items: '{{ proxy_certificates }}'
    
      when: not item.letsencrypt|default(false)
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify: 'Proxy | Restart HAProxy'
    
    - name: "Proxy | Create host lists"
      template: src=host_list
                dest=/etc/haproxy/{{item}}.list
                owner=root
                group=root
                mode=644
    
      #when: scope == 'all'
    
      with_items: '{{ groups.all }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify: 'Proxy | Restart HAProxy'
    
    - name: "Proxy | Create host ssl lists"
      template: src=host_ssl_list
                dest=/etc/haproxy/{{item}}.ssl.list
                owner=root
                group=root
                mode=644
    
      #when: scope == 'all'
    
      with_items: '{{ groups.all }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify: 'Proxy | Restart HAProxy'
    
    - name: "Proxy | Create empty crm lists files"
      file: dest=/etc/haproxy/{{item}}.crm.list
            owner=root
            group=root
            mode=644
            state=touch
    
      #when: scope == 'all'
    
      with_items: '{{ groups.all }}'
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify: 'Proxy | Restart HAProxy'
    
    - name: "Proxy | Create config file"
      template: src=haproxy_cfg
                dest=/etc/haproxy/haproxy.cfg
                owner=root
                group=root
                mode=644
    
      #when: scope == 'all'
    
    jurgenhaas's avatar
    jurgenhaas committed
      notify: 'Proxy | Restart HAProxy'
    
    - name: "Proxy | Install update php script"
      copy: src=etc_haproxy_update_update_php
            dest=/etc/haproxy/update/update.php
            owner=root
            group=root
            mode=444
    
    
    - name: "Proxy | Update blacklist"
      template: src=blacklist
                dest=/etc/haproxy/blacklist
                owner=root
                group=root
                mode=644
    
      #when: scope == 'all'
    
      notify: 'Proxy | Restart HAProxy'