Consistent newhost format between roles

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:20 -04:00
parent f1cca0e22f
commit aef72555c1
2 changed files with 18 additions and 10 deletions

View File

@ -2,11 +2,19 @@
# #
# First run check # First run check
# #
- name: first run check - name: check if this is a new instance
shell: "echo 'bootstrapped' > /etc/pvc-base-install" shell: "echo 'bootstrapped' > /etc/pvc-install.base"
register: newhost
args: args:
creates: "/etc/pvc-base-install" creates: /etc/pvc-install.base
register: newhost_check
tags: always
- name: set newhost fact
set_fact:
newhost: yes
when: newhost_check.changed
tags: always
# #
# Install custom fact scripts # Install custom fact scripts
@ -73,27 +81,27 @@
- name: apt update - name: apt update
apt: apt:
update-cache: yes update-cache: yes
when: newhost.changed when: newhost is defined and newhost
- name: aptitude safe upgrade with autoremove - name: aptitude safe upgrade with autoremove
apt: apt:
update_cache: yes update_cache: yes
autoremove: yes autoremove: yes
upgrade: safe upgrade: safe
when: newhost.changed when: newhost is defined and newhost
- name: install dbus - name: install dbus
apt: apt:
name: name:
- dbus - dbus
state: latest state: latest
when: newhost.changed when: newhost is defined and newhost
- name: clean out apt cache - name: clean out apt cache
file: file:
path: "/var/cache/apt/archives" path: "/var/cache/apt/archives"
state: absent state: absent
when: newhost.changed when: newhost is defined and newhost
# #
# Purge unneeded packages # Purge unneeded packages

View File

@ -2,9 +2,9 @@
# First-run check # First-run check
- name: check if this is a new instance - name: check if this is a new instance
shell: "echo 'bootstrapped' > /etc/pvc-pvc-install" shell: "echo 'bootstrapped' > /etc/pvc-install.pvc"
args: args:
creates: /etc/pvc-pvc-install creates: /etc/pvc-install.pvc
register: newhost_check register: newhost_check
tags: always tags: always