---
- hosts: app-servers
  become: True

  pre_tasks:
    - name: Update APT cache
      apt: update_cache=yes cache_valid_time=3600

    - name: Add monitoring hostname to /etc/hosts
      lineinfile: dest="/etc/hosts"
                  regexp="^127.0.0.1"
                  line="127.0.0.1 localhost {{ statsite_host }}"
      when: "['packer'] | is_in(group_names)"

    - name: Add Docker APT Key
      shell: "curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"

  roles:
    - { role: "bee-pollinator.app" }
    - { role: "bee-pollinator.beekeepers" }

  post_tasks:
    - name: Revert change to /etc/hosts
      lineinfile: dest="/etc/hosts"
                  regexp="^127.0.0.1"
                  line="127.0.0.1 localhost"
      when: "['packer'] | is_in(group_names)"

---
- hosts: app-servers
  become: True

  pre_tasks:
    - name: Update APT cache
      apt: update_cache=yes cache_valid_time=3600

    - name: Add monitoring hostname to /etc/hosts
      lineinfile: dest="/etc/hosts"
                  regexp="^127.0.0.1"
                  line="127.0.0.1 localhost {{ statsite_host }}"
      when: "['packer'] | is_in(group_names)"

    - name: Add Docker APT Key
      shell: "curl -sSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -"
      args:
        warn: no

  roles:
    - { role: "bee-pollinator.app" }
    - { role: "bee-pollinator.beekeepers" }

  post_tasks:
    - name: Revert change to /etc/hosts
      lineinfile: dest="/etc/hosts"
                  regexp="^127.0.0.1"
                  line="127.0.0.1 localhost"
      when: "['packer'] | is_in(group_names)"

Disable use of curl w/ shell warning
Disable use of curl w/ shell warning
