Created
October 22, 2019 17:38
-
-
Save hartsock/7c88cd7552fade836574e67196123571 to your computer and use it in GitHub Desktop.
An Ansible playbook for upgrading VMware Photon OS 2.x to 3.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: photon | |
remote_user: root | |
tasks: | |
- name: pip prerequisite | |
command: bash -c "tdnf -y install python-pip" | |
- name: python prerequisites | |
command: bash -c "pip install -I pexpect" | |
- name: install upgrade script for photon | |
command: bash -c "tdnf -y install photon-upgrade" | |
- name: upgrade photon OS from v 2 to v 3 | |
expect: | |
command: /usr/bin/photon-upgrade.sh | |
responses: | |
(?i)\(y\/n\)\?: y | |
register: upgraded_result | |
- name: wait for reboot | |
wait_for_connection: | |
connect_timeout: 30 | |
sleep: 10 | |
delay: 5 | |
timeout: 300 | |
when: upgraded_result is changed | |
- name: update tdnf | |
command: bash -c "tdnf updateinfo && tdnf upgrade -y " | |
when: upgraded_result is changed | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment