Adding final ESXI deployment code

This commit is contained in:
Chris Long
2020-03-09 14:42:58 -07:00
parent e78b08a901
commit 4e850a5ee6
35 changed files with 988 additions and 168 deletions

View File

@@ -0,0 +1,48 @@
---
- name: Set hostname to logger
hostname:
name: logger
become: yes
- name: Create a directory if it does not exist
file:
path: /vagrant
state: directory
mode: '0755'
become: yes
- name: Copy vagrant resources
synchronize:
src: ../../Vagrant/resources
dest: /vagrant/
become: yes
- name: Copy bootstrap file
copy:
src: ../../Vagrant/bootstrap.sh
dest: /home/vagrant
owner: vagrant
group: vagrant
mode: u+x,g+x
- name: Copy netplan file
copy:
src: ../resources/01-netcfg.yaml
dest: /tmp
owner: vagrant
group: vagrant
- name: Copy the netplan file over as root
shell: "mv /tmp/01-netcfg.yaml /etc/netplan/01-netcfg.yaml"
become: yes
- name: Apply the new netplan
shell: netplan apply
become: yes
- name: Run bootstrap.sh
shell: /home/vagrant/bootstrap.sh | tee -a /home/vagrant/bootstrap.log
args:
executable: /bin/bash
become: yes