Matteo Scandolo | ede125b | 2017-08-08 13:05:25 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Scott Baker | c41914d | 2017-06-26 14:00:52 -0700 | [diff] [blame] | 17 | --- |
| 18 | - hosts: localhost |
| 19 | vars: |
| 20 | amc_hostname: "localhost:3456" |
| 21 | amc_username: "co@opencloud.us" |
| 22 | amc_password: "XOScdn123$" |
| 23 | amc_plc_name: "CoBlitz Test" |
| 24 | amc_remote_hostname: "10.6.1.197" |
| 25 | rrnode_hostname: "rr1.lab.local" |
| 26 | tasks: |
| 27 | - name: Create site |
| 28 | act_site: |
| 29 | name: examplesite |
| 30 | username: "{{ amc_username }}" |
| 31 | password: "{{ amc_password }}" |
| 32 | hostname: "{{ amc_hostname }}" |
| 33 | plc_name: "{{ amc_plc_name }}" |
| 34 | state: present |
| 35 | |
| 36 | - name: Create rr node |
| 37 | act_rr: |
| 38 | name: "{{ rrnode_hostname }}" |
| 39 | site: examplesite |
| 40 | dns: |
| 41 | - "8.8.8.8" |
| 42 | - "8.8.4.4" |
| 43 | interfaces: |
| 44 | - mac_addr: "DE:AD:BE:EF:01:01" |
| 45 | management: True |
| 46 | if_name: eth0 |
| 47 | IpAddresses: |
| 48 | - netmask: "16" |
| 49 | address: "192.168.1.200" |
| 50 | logical: |
| 51 | - Client-Serving |
| 52 | Routes: |
| 53 | - subnet: 0.0.0.0/0 |
| 54 | metric: 0 |
| 55 | nexthop: 192.168.1.1 |
| 56 | username: "{{ amc_username }}" |
| 57 | password: "{{ amc_password }}" |
| 58 | hostname: "{{ amc_hostname }}" |
| 59 | plc_name: "{{ amc_plc_name }}" |
| 60 | remote_hostname: "{{ amc_remote_hostname }}" |
| 61 | state: present |
| 62 | force: true |
| 63 | register: rrnode |
| 64 | |
| 65 | - name: Save bootscript |
| 66 | copy: |
| 67 | content: "{{ rrnode.setupscript }}" |
| 68 | dest: "/tmp/{{ rrnode_hostname }}" |
| 69 | when: rrnode.changed |