softplayer-ansible/playbooks/systems/system-bootstrap/tasks/netplan.yaml

33 lines
855 B
YAML

---
- name: Netplan config
when: ansible_distribution == 'Ubuntu'
block:
- name: Update the netplan config
become: true
ansible.builtin.template:
src: templates/60-floating-ip.j2
dest: /etc/netplan/60-floating-ip.yaml
owner: root
group: root
mode: '0600'
vars:
publicIP: 195.201.250.50
- name: Apply a new config
become: true
ansible.builtin.shell: netplan apply
- name: Ifcfg onfig
when: ansible_distribution == 'Rocky'
block:
- name: Update the ifcfg config
notify: Restart the network service
become: true
ansible.builtin.template:
src: templates/ifcfg-eth0:1.j2
dest: /etc/sysconfig/network-scripts/ifcfg-eth0:1
owner: root
group: root
mode: '0600'
vars:
publicIP: 195.201.249.91