Skip to content

Commit

Permalink
ansible: update unofficial-builds scripts to run again, install newer…
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Feb 23, 2024
1 parent 0a0ed87 commit 495fbc4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 22 deletions.
7 changes: 5 additions & 2 deletions ansible/roles/docker/tasks/partials/repo/ubuntu1804.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
#

- name: "repo : add Ubuntu Docker repo key"
raw: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
ansible.builtin.apt_key:
state: present
url: https://download.docker.com/linux/ubuntu/gpg

- name: "repo : add Ubuntu Docker repo"
raw: add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
ansible.builtin.apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
register: has_updated_package_repo

- name: "repo : update apt cache"
Expand Down
53 changes: 34 additions & 19 deletions ansible/roles/unofficial-builds/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,47 @@
loop_var: package
with_items: "{{ base_packages }}"

- name: Bootstrap | Add nodesource signing key
apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
state: present
- name: Bootstrap | Ensure keyrings directory exists
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
owner: root
group: root
mode: '0755'

- name: Bootstrap | Download nodesource signing key
ansible.builtin.get_url:
url: https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key
dest: /tmp/nodesource-repo.gpg.key
mode: '0644'

- name: Bootstrap | De-armoring GPG key
ansible.builtin.shell:
cmd: gpg --dearmor < /tmp/nodesource-repo.gpg.key > /etc/apt/keyrings/nodesource.gpg
creates: /etc/apt/keyrings/nodesource.gpg

- name: Bootstrap | Add nodesource repo
apt_repository:
repo: deb https://deb.nodesource.com/node_10.x jessie main
ansible.builtin.apt_repository:
repo: "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main"
state: present

- name: letsencrypt | Add certbot ppa
apt_repository:
repo: 'ppa:certbot/certbot'
state: present
- name: letsencrypt | Add certbot snap
community.general.snap:
name: certbot

- name: Bootstrap | APT Update and upgrade
apt:
classic: true
- name: Bootstrap | APT update and upgrade
ansible.builtin.apt:
update_cache: yes
upgrade: full

- name: Bootstrap | Install packages
package:
name: "{{ package }}"
state: present
- name: Bootstrap | Install and upgrade packages
ansible.builtin.apt:
name: "{{ item }}"
state: latest
loop: "{{ packages }}"
loop_control:
loop_var: package
with_items: "{{ packages }}"
loop_var: item

- name: Bootstrap | Enable time syncing
service:
Expand Down Expand Up @@ -73,9 +87,10 @@
- name: Init | Clone unofficial-builds repo
become: yes
become_user: "nodejs"
git:
ansible.builtin.git:
repo: https://github.com/nodejs/unofficial-builds
dest: "/home/nodejs/unofficial-builds"
version: "main"

- name: Deploy Webhook | Install github-webhook
npm:
Expand Down
4 changes: 3 additions & 1 deletion ansible/roles/unofficial-builds/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ base_packages:
- python-apt

packages:
- nodejs,git,nginx,logrotate,certbot,python-certbot-nginx
- nodejs
- git
- logrotate

0 comments on commit 495fbc4

Please sign in to comment.