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 | cachenode_hostname: "hpc1.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: Get license |
| 37 | set_fact: license="{{ lookup('file', 'license.txt') }}" |
| 38 | |
| 39 | - name: Create node |
| 40 | act_cachenode: |
| 41 | name: "{{ cachenode_hostname }}" |
| 42 | site: examplesite |
| 43 | dns: |
| 44 | - "8.8.8.8" |
| 45 | - "8.8.4.4" |
| 46 | interfaces: |
| 47 | - mac_addr: "DE:AD:BE:EF:01:01" |
| 48 | management: True |
| 49 | if_name: eth0 |
| 50 | IpAddresses: |
| 51 | - netmask: "16" |
| 52 | address: "192.168.1.2" |
| 53 | logical: |
| 54 | - Client-Serving |
| 55 | Routes: |
| 56 | - subnet: 0.0.0.0/0 |
| 57 | metric: 0 |
| 58 | nexthop: 192.168.1.1 |
| 59 | license: "{{ license }}" |
| 60 | username: "{{ amc_username }}" |
| 61 | password: "{{ amc_password }}" |
| 62 | hostname: "{{ amc_hostname }}" |
| 63 | plc_name: "{{ amc_plc_name }}" |
| 64 | remote_hostname: "{{ amc_remote_hostname }}" |
| 65 | state: present |
| 66 | force: true |
| 67 | register: cachenode |
| 68 | |
| 69 | - name: Save bootscript |
| 70 | copy: |
| 71 | content: "{{ cachenode.setupscript }}" |
| 72 | dest: "/tmp/{{ cachenode_hostname }}" |
| 73 | when: cachenode.changed |