Add configuration playbooks for setting up various system components
This commit is contained in:
37
playbooks/configure-network.yml
Normal file
37
playbooks/configure-network.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
- import_playbook: meta.yml
|
||||
|
||||
- name: Configure router
|
||||
hosts: router
|
||||
gather_facts: false
|
||||
pre_tasks:
|
||||
- name: Collect EdgeOS facts
|
||||
edgeos_facts:
|
||||
gather_subset: "!config"
|
||||
tasks:
|
||||
- name: Configure interfaces
|
||||
edgeos_config:
|
||||
lines:
|
||||
- set interfaces ethernet eth0 address dhcp
|
||||
- set interfaces ethernet eth0 description EXTERNAL
|
||||
- set interfaces ethernet eth1 address 10.42.100.1/24
|
||||
- set interfaces ethernet eth1 address 10.42.99.1/24
|
||||
- set interfaces ethernet eth1 description LOCAL
|
||||
- set interfaces ethernet eth2 address 10.42.101.1/24
|
||||
- set interfaces ethernet eth2 description DOMAIN
|
||||
|
||||
- name: Configure servers
|
||||
hosts: servers
|
||||
roles:
|
||||
- role: networkd
|
||||
tasks:
|
||||
- name: Configure local hostsfile
|
||||
become: true
|
||||
lineinfile:
|
||||
path: /etc/hosts
|
||||
state: present
|
||||
line: "{{ item }}"
|
||||
loop:
|
||||
- "192.168.42.10 jupiter.svr.local"
|
||||
- "192.168.42.20 remus.svr.local"
|
||||
- "192.168.42.30 romulus.svr.local"
|
||||
Reference in New Issue
Block a user