- name: ansible from upstream
  hosts: all
  become: yes
  become_user: root
  tasks:
  - name: apt key
    apt_key:
      id: 93C4A3FD7BB9C367
      keyserver: keyserver.ubuntu.com
      state: present
  - name: apt list
    apt_repository:
      filename: ansible
      repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main
      state: present
  - name: install
    apt:
      update_cache: yes
      name:
        - ansible
      state: latest

- name: install collections
  hosts: all
  tasks:
  - name: install community.general
    shell:
      cmd: ansible-galaxy collection install community.general
      creates: /root/.ansible/collections/ansible_collections/community/general/

- name: file properties
  hosts: all
  become: yes
  become_user: root
  tasks:
  - file:
      path: /etc/ansible/hosts
      group: staff
      mode: g+w

- name: install deno
  hosts: all
#  become: yes
#  become_user: root
  tasks:
  - name: install or update deno
    shell:
      cmd: if which deno; then deno upgrade; else curl -fsSL https://deno.land/x/install/install.sh | sh; ulb ~/.deno/bin/deno; fi
