diff --git a/inventories/pubs/inventory.yml b/inventories/pubs/inventory.yml index 350a827..3442b4c 100644 --- a/inventories/pubs/inventory.yml +++ b/inventories/pubs/inventory.yml @@ -2,6 +2,7 @@ pubs: vars: ansible_user: root + admin_username: root hosts: one.planetary.pub: two.planetary.pub: diff --git a/playbooks/pubs/pub-follow-count.yml b/playbooks/pubs/pub-follow-count.yml new file mode 100644 index 0000000..0a32f9a --- /dev/null +++ b/playbooks/pubs/pub-follow-count.yml @@ -0,0 +1,11 @@ +--- +# Prints the number of people a pub is following +# Usage: ansible-playbook pub-follow-count.yml -i {inventory} +- name: Pub Follow Count + hosts: pubs + tasks: + - name: Get follow count + shell: "./sbot friends.hops | grep \": 1\" | wc -l" + register: follow_count + - debug: + msg: "follow count: {{ follow_count.stdout }}" diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 4b313b9..2ba3040 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,18 +1,29 @@ +# This are leftovers from an old method of installing the Digital Ocean metrics agent, and they are causing +# problems now. +- name: Delete old Digital Ocean Metrics agent files + become: true + ansible.builtin.file: + path: '{{ item }}' + state: absent + with_items: + - /usr/share/keyrings/digitalocean-agent-keyring.gpg + - /etc/apt/sources.list.d/droplet-agent.list.save + - /etc/apt/sources.list.d/droplet-agent.list + - /etc/apt/sources.list.d/digitalocean-agent.list + - /etc/apt/sources.list.d/repos_insights_digitalocean_com_apt_do_agent.list + + - name: Perform a dist-upgrade. become: true ansible.builtin.apt: upgrade: dist - register: dist_upgraded - retries: 10 - delay: 5 - until: dist_upgraded is success + update_cache: yes + cache_valid_time: 3600 - name: update cache become: true ansible.builtin.apt: - update_cache: yes - cache_valid_time: 3600 - name: Remove dependencies that are no longer required. @@ -62,6 +73,7 @@ - jq - tmux - mosh + - gnupg state: latest register: pkgs_added retries: 10 diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index ddc9111..7a4c252 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -47,7 +47,9 @@ - name: Update apt and install docker-ce become: true ansible.builtin.apt: - pkg: docker-ce + pkg: + - docker-ce + - python3-docker state: latest update_cache: true cache_valid_time: 3600