728x90
728x90
# vi portgroup.yml
---
- hosts: localhost
vars:
ansible_python_interpreter: /bin/python3
gather_facts: no
esxi_hostname: "172.16.10.14"
esxi_username: "root"
esxi_password: "VMware1!"
project_id: "khb-00"
private_net: "{{ project_id + '-Openshift' }}"
tasks:
- name: 03. Adding Private Openshift Portgroup
community.vmware.vmware_portgroup:
validate_certs: false
hostname: "{{ esxi_hostname }}"
username: "{{ esxi_username }}"
password: "{{ esxi_password }}"
hosts: "{{ esxi_hostname }}" # ESXi 서버에 직접 접속해서 처리할 경우 명시가 필요함.
switch: "{{ project_id }}"
portgroup: "{{ private_net }}"
delegate_to: localhost
- name: waiting vswitch creating
wait_for:
timeout: 5
delegate_to: localhost
# ansible-playbook portgroup.yml
728x90
'Ansible' 카테고리의 다른 글
Ansible Openshift on vSphere VM (BareMetal) - 5. Router 설정하기 (0) | 2023.11.21 |
---|---|
Ansible Openshift on vSphere VM (BareMetal) - 4. Router VM 만들기 (0) | 2023.11.21 |
Ansible Openshift on vSphere VM (BareMetal) - 2. Openshift 프로젝트를 위한 스위치 만들기 (0) | 2023.11.21 |
Ansible Openshift on vSphere VM (BareMetal) - 1. VM 폴더 생성 (0) | 2023.11.21 |
Ansible Inventory설정, add-hoc, play북 (0) | 2023.09.19 |