final update to creating VMs
This commit is contained in:
@@ -15,11 +15,11 @@
|
||||
register: proxmox_vm_info
|
||||
|
||||
- name: Extract net0 information
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
vm_net0: "{{ proxmox_vm_info.proxmox_vms[0].config.net0 }}"
|
||||
|
||||
- name: Extract MAC address using regex
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
vm_mac_address: "{{ vm_net0 | regex_search('([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}') }}"
|
||||
|
||||
- name: Add line to hosts file
|
||||
@@ -28,7 +28,7 @@
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/dnsmasq.d/hosts.conf
|
||||
regexp: "# {{ inventory_hostname }}$"
|
||||
line: "dhcp-host={{ vm_mac_address|lower }},{{ ip_address }} # {{ inventory_hostname }}"
|
||||
line: "dhcp-host={{ vm_mac_address | lower }},{{ ip_address }} # {{ inventory_hostname }}"
|
||||
state: present
|
||||
# restart dnsmasq service
|
||||
- name: Restart service dnsmasq
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
gather_facts: false
|
||||
|
||||
tasks:
|
||||
- name: Create DNS entry for {{ inventory_hostname }} #on {{ groups['ipa_servers'][0] }}
|
||||
- name: Create DNS entry for {{ inventory_hostname }}
|
||||
delegate_to: "{{ groups['ipaserver'][0] }}"
|
||||
freeipa.ansible_freeipa.ipadnsrecord:
|
||||
ipaapi_context: "server"
|
||||
@@ -14,4 +14,4 @@
|
||||
record_type: "A"
|
||||
record_value: "{{ ip_address }}"
|
||||
record_ttl: 60
|
||||
#create_reverse: yes
|
||||
# create_reverse: yes
|
||||
|
||||
0
infra-config/playbooks/alertmanager.yml
Normal file
0
infra-config/playbooks/alertmanager.yml
Normal file
@@ -9,4 +9,3 @@
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
ansible.builtin.hostname:
|
||||
name: "{{ hostname }}"
|
||||
#delay: 20
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
Upgrade Result: {{ upgrade_result }}
|
||||
Autoremove Result: {{ autoremove_result }}
|
||||
|
||||
|
||||
- name: Upgrade RHEL systems with DNF
|
||||
when: ansible_os_family == "RedHat" and not (ansible_distribution_major_version == "7")
|
||||
block:
|
||||
|
||||
Reference in New Issue
Block a user