Skip to content

Commit

Permalink
deploy playbook_ISP
Browse files Browse the repository at this point in the history
  • Loading branch information
dotruong576 committed Nov 28, 2024
1 parent b2d1800 commit 6f4078a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/deploy_network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
if [[ "${{ env.COMMIT_MSG }}" == *"playbook"* ]]; then
ansible-playbook -i inventory playbook.yml
elif [[ "${{ env.COMMIT_MSG }}" == *"playbook2"* ]]; then
ansible-playbook -i inventory playbook2.yml
ansible-playbook -i inventory playbook_ISP.yml
else
echo "No matching playbook found for commit message: ${{ env.COMMIT_MSG }}"
fi
62 changes: 62 additions & 0 deletions Network/playbook_ISP.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
# Deploy configuration to Cisco device ISP
- name: Deploy configuration to Cisco device ISP
hosts: cisco_devices_ISP
gather_facts: false
tasks:
- name: Configure DHCP server
cisco.ios.ios_command:
commands:
- "enable"
- "config terminal"
- "ip dhcp pool vlan1"
- "network 192.168.1.0 255.255.255.0"
- "default-router 192.168.1.1"
- "ip dhcp pool vlan2"
- "network 192.168.2.0 255.255.255.0"
- "default-router 192.168.2.1"
- "ip dhcp pool vlan3"
- "network 192.168.3.0 255.255.255.0"
- "default-router 192.168.3.1"

- name: Deploy configuration to Cisco device ISP 1
hosts: cisco_devices_ISP_1
gather_facts: false
tasks:
- name: Configure Ethernet0/2
cisco.ios.ios_command:
commands:
- "enable"
- "config terminal"
- "interface e0/2"
- "no shutdown"
- "ip address 172.16.11.1 255.255.255.0"
- name: Configure Static Route
cisco.ios.ios_command:
commands:
- "enable"
- "config terminal"
- "ip route 192.168.1.0 255.255.255.0 172.16.11.2"
- "ip route 192.168.2.0 255.255.255.0 172.16.11.2"
- "ip route 192.168.3.0 255.255.255.0 172.16.11.2"

- name: Deploy configuration to Cisco device ISP 2
hosts: cisco_devices_ISP_2
gather_facts: false
tasks:
- name: Configure Ethernet0/2
cisco.ios.ios_command:
commands:
- "enable"
- "config terminal"
- "interface e0/2"
- "no shutdown"
- "ip address 172.16.12.1 255.255.255.0"
- name: Configure Static Route
cisco.ios.ios_command:
commands:
- "enable"
- "config terminal"
- "ip route 192.168.1.0 255.255.255.0 172.16.12.2"
- "ip route 192.168.2.0 255.255.255.0 172.16.12.2"
- "ip route 192.168.3.0 255.255.255.0 172.16.12.2"

0 comments on commit 6f4078a

Please sign in to comment.