- name: install nginx
  apt: pkg=nginx state=installed

- name: configure letsencrypt config for misc
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/letsencrypt.conf
  vars:
    cert_id: "{{ letsencrypt_dir }}"

- name: configure letsencrypt config for foip_me
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/foipme.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "foip.me"

- name: configure letsencrypt config for istic
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/istic.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "istic.net"

- name: configure letsencrypt config for istic
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/carcosadreams_ssl.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "carcosadreams.com"
  tags:
    - carcosadreams

- name: Fix diffie-hellman insecurites
  include: diffie-hellman.yml

- name: Add clacks overhead to nginx
  copy: 
    dest: /etc/nginx/conf.d/clacks.conf
    src: files/clacks.conf 
    owner: root 
    group: root
  notify:
   - restart nginx

- name: install nginx
  apt: 
    pkg: nginx 
    state: present

- name: configure letsencrypt config for misc
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/letsencrypt.conf
  vars:
    cert_id: "{{ letsencrypt_dir }}"

- name: configure letsencrypt config for foip_me
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/foipme.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "foip.me"

- name: configure letsencrypt config for istic
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/istic.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "istic.net"

- name: configure letsencrypt config for istic
  template: 
    src: letsencrypt.conf.j2 
    dest: /etc/nginx/snippets/carcosadreams_ssl.conf
  when: "'archipelago' in inventory_hostname"
  vars:
    cert_id: "carcosadreams.com"
  tags:
    - carcosadreams

- name: Fix diffie-hellman insecurites
  include: diffie-hellman.yml

- name: Add clacks overhead to nginx
  copy: 
    dest: /etc/nginx/conf.d/clacks.conf
    src: files/clacks.conf 
    owner: root 
    group: root
  notify:
   - restart nginx

Update for new Ansible syntax
Update for new Ansible syntax
