Skip to content

Commit

Permalink
Upgrade CentOS after build, upgrade Debian during build
Browse files Browse the repository at this point in the history
Upgrade from 7.8 to 7.9 on CentOS cause issue after sysprep (non-bootable image)
  • Loading branch information
nqb committed Feb 23, 2021
1 parent e035d61 commit 4261fd5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions addons/vagrant/site.yml
@@ -1,5 +1,7 @@
---
# no sub directory for ansible playbooks to find roles under roles/ directory
- import_playbook: upgrade_centos_os.yml

- import_playbook: config_dev_repos.yml

- import_playbook: install_pf.yml
Expand Down
18 changes: 18 additions & 0 deletions addons/vagrant/upgrade_centos_os.yml
@@ -0,0 +1,18 @@
- hosts: pfservers
name: upgrade CentOS OS to latest version
become: True
gather_facts: True
tags: upgrade

tasks:
- name: update to latest OS version (EL)
yum:
name: '*'
state: latest
update_cache: yes
register: upgrade_os_el_register
when: ansible_os_family == 'RedHat'

- name: reboot to have latest Linux kernel packages in place when installing PacketFence
reboot:
when: upgrade_os_el_register is changed
@@ -1,5 +1,5 @@
- hosts: pfservers
name: upgrade OS to latest version
name: upgrade Debian OS to latest version
become: True
gather_facts: True
tags: upgrade
Expand All @@ -13,14 +13,7 @@
register: upgrade_os_deb_register
when: ansible_os_family == 'Debian'

- name: update to latest OS version (EL)
yum:
name: '*'
state: latest
update_cache: yes
register: upgrade_os_el_register
when: ansible_os_family == 'RedHat'

- name: reboot to have latest Linux kernel packages in place when installing PacketFence
reboot:
when: (upgrade_os_deb_register is changed or upgrade_os_el_register is changed)
when: upgrade_os_deb_register is changed
2 changes: 1 addition & 1 deletion ci/packer/vagrant_img/provisioners/site.yml
@@ -1,5 +1,5 @@
---
- import_playbook: playbooks/upgrade_os.yml
- import_playbook: playbooks/upgrade_debian_os.yml

- import_playbook: playbooks/install_repos.yml

Expand Down

0 comments on commit 4261fd5

Please sign in to comment.