diff --git a/.github/workflows/deploy_network.yml b/.github/workflows/deploy_network.yml index 4efa223..0fef956 100644 --- a/.github/workflows/deploy_network.yml +++ b/.github/workflows/deploy_network.yml @@ -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 \ No newline at end of file diff --git a/Network/playbook_ISP.yml b/Network/playbook_ISP.yml new file mode 100644 index 0000000..5c30ea5 --- /dev/null +++ b/Network/playbook_ISP.yml @@ -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" \ No newline at end of file