Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get pub playbook running again #107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions inventories/pubs/inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pubs:
vars:
ansible_user: root
admin_username: root
hosts:
one.planetary.pub:
two.planetary.pub:
Expand Down
11 changes: 11 additions & 0 deletions playbooks/pubs/pub-follow-count.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
24 changes: 18 additions & 6 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this task got orphaned somewhere in here? Do we still want this one to do something, or should we remove it?

become: true
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 3600


- name: Remove dependencies that are no longer required.
Expand Down Expand Up @@ -62,6 +73,7 @@
- jq
- tmux
- mosh
- gnupg
state: latest
register: pkgs_added
retries: 10
Expand Down
4 changes: 3 additions & 1 deletion roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down