Adding final ESXI deployment code
This commit is contained in:
48
ESXi/ansible/roles/logger/tasks/main.yml
Normal file
48
ESXi/ansible/roles/logger/tasks/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user