-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor ansible config and templates
- Loading branch information
1 parent
2e7331a
commit 5d0f8b4
Showing
15 changed files
with
85 additions
and
32 deletions.
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
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 @@ | ||
--- | ||
api: | ||
enable: true | ||
api_keys: | ||
- name: KID | ||
key: foo |
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,4 @@ | ||
--- | ||
name_servers: | ||
- 1.1.1.1 | ||
- 8.8.8.8 |
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,10 @@ | ||
--- | ||
routing: | ||
bgp: | ||
enable: true | ||
asn: 65001 | ||
ospf: | ||
enable: false | ||
area: 0 | ||
isis: | ||
enable: true |
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 |
---|---|---|
|
@@ -28,3 +28,6 @@ isis: | |
net: 49.0001.1920.0200.0011.00 | ||
interfaces: | ||
- eth1 | ||
|
||
bgp: | ||
neighbor: 192.0.2.1 |
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 |
---|---|---|
|
@@ -28,3 +28,6 @@ isis: | |
net: 49.0001.1920.0200.0014.00 | ||
interfaces: | ||
- eth1 | ||
|
||
bgp: | ||
neighbor: 192.0.2.5 |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[vyos_hosts] | ||
r1 ansible_ssh_host=192.168.122.11 | ||
r4 ansible_ssh_host=192.168.122.14 | ||
r1 ansible_ssh_host=192.168.122.11 vyos_version='1.3' | ||
r4 ansible_ssh_host=192.168.122.14 vyos_version='1.5' |
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
- hosts: r4 | ||
- hosts: vyos_hosts | ||
gather_facts: false | ||
|
||
tasks: | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
roles: | ||
- interfaces | ||
- common | ||
- banner | ||
- routing | ||
- api |
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,24 @@ | ||
--- | ||
|
||
- name: Configure name-servers | ||
vyos.vyos.vyos_config: | ||
src: nameservers.j2 | ||
|
||
#- name: Debug hostvars for r1 | ||
# debug: | ||
# var: hostvars['r1'] | ||
|
||
#- name: Debug hostvars for r4 | ||
# debug: | ||
# var: hostvars['r4'] | ||
|
||
- name: Configure host-name | ||
vyos.vyos.vyos_config: | ||
lines: | ||
- set system host-name {{ inventory_hostname }} | ||
|
||
- name: Configure time format | ||
vyos.vyos.vyos_config: | ||
lines: | ||
- set system option time-format '24-hour' | ||
when: hostvars[inventory_hostname].vyos_version == 1.5 |
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,3 @@ | ||
{% for nameserver in name_servers %} | ||
set system name-server '{{ nameserver }}' | ||
{% endfor %} |
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,9 @@ | ||
{% if routing.bgp.enable %} | ||
{% if vyos_version == 1.5 %} | ||
set protocol bgp system-as '{{ routing.bgp.asn }}' | ||
{% endif %} | ||
{% set asn = '' if vyos_version == 1.5 or vyos_version == 1.4 else routing.bgp.asn %} | ||
set protocols bgp {{ asn }} neighbor {{ bgp.neighbor }} remote-as {{ routing.bgp.asn }} | ||
set protocols bgp {{ asn }} neighbor {{ bgp.neighbor }} address-family ipv4-unicast soft-reconfiguration inbound | ||
set protocols bgp {{ asn }} neighbor {{ bgp.neighbor }} description 'Configured by ansible' | ||
{% endif %} |
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