-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add edgerouter role to deploy DHCP server and static hosts. * Deploy cycletrailer's DHCP config.
- Loading branch information
Showing
5 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
edgerouter_dhcp_networks: | ||
- name: cycledhcp | ||
subnet: 10.20.0.0/16 | ||
static-hosts: | ||
- hostname: earl.noise | ||
ipaddress: 10.20.0.10 | ||
mac-address: b8:27:eb:0c:c6:e9 | ||
- hostname: enter-ap.noise | ||
ipaddress: 10.20.0.13 | ||
mac-address: 80:2a:a8:c0:f7:44 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
edgerouter_dhcp_subnets: | ||
internal: | ||
subnet: 192.168.0.0/24 | ||
|
||
edgerouter_static_hosts: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
- name: Create DHCP network | ||
edgeos_config: | ||
lines: | ||
- "set system dhcp-server shared-network-name {{ item.name }} subnet {{ item.subnet }}" | ||
connection: network_cli | ||
with_items: "{{ edgerouter_dhcp_networks }}" | ||
|
||
- name: Add static hosts | ||
edgeos_config: | ||
lines: | ||
- "set system static-host-mapping host-name {{ item.1.hostname }} inet {{ item.1.ipaddress }}" | ||
- "set service dhcp-server shared-network-name {{ item.0.name }} subnet {{ item.0.subnet }} static-mapping {{ item.1.hostname }} ip-address {{ item.1.ipaddress }}" | ||
- "set service dhcp-server shared-network-name {{ item.0.name }} subnet {{ item.0.subnet }} static-mapping {{ item.1.hostname }} mac-address '{{ item.1.mac-address }}'" | ||
connection: network_cli | ||
with_subelements: | ||
- "{{ edgerouter_dhcp_networks }}" | ||
- static-hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters