Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
Sergio Slobodrian | 8725ea8 | 2017-08-27 23:47:41 -0400 | [diff] [blame] | 14 | - name: The glusterfs registry volume is created |
Sergio Slobodrian | 523ee78 | 2017-08-22 16:44:21 -0400 | [diff] [blame] | 15 | gluster_volume: |
Sergio Slobodrian | 8725ea8 | 2017-08-27 23:47:41 -0400 | [diff] [blame] | 16 | bricks: "{{ barrier_fs_dir }}/reg_brick1" |
Sergio Slobodrian | 523ee78 | 2017-08-22 16:44:21 -0400 | [diff] [blame] | 17 | force: true |
| 18 | cluster: "{{groups.cluster | join(\",\")}}" |
| 19 | replicas: 3 |
| 20 | name: registry_volume |
| 21 | state: present |
| 22 | run_once: true |
| 23 | |
Sergio Slobodrian | 8725ea8 | 2017-08-27 23:47:41 -0400 | [diff] [blame] | 24 | - name: The glusterfs logging volume is created |
Sergio Slobodrian | 523ee78 | 2017-08-22 16:44:21 -0400 | [diff] [blame] | 25 | gluster_volume: |
Sergio Slobodrian | 8725ea8 | 2017-08-27 23:47:41 -0400 | [diff] [blame] | 26 | bricks: "{{ barrier_fs_dir }}/log_brick1" |
| 27 | force: true |
| 28 | cluster: "{{groups.cluster | join(\",\")}}" |
| 29 | disperses: 3 |
| 30 | name: logging_volume |
| 31 | state: present |
| 32 | run_once: true |
| 33 | |
| 34 | - name: Start the gluster volumes |
| 35 | gluster_volume: |
| 36 | name: "{{ item }}" |
Sergio Slobodrian | 523ee78 | 2017-08-22 16:44:21 -0400 | [diff] [blame] | 37 | state: started |
Sergio Slobodrian | 8725ea8 | 2017-08-27 23:47:41 -0400 | [diff] [blame] | 38 | with_items: |
| 39 | - registry_volume |
| 40 | - logging_volume |
| 41 | |
Stephane Barbarie | 2cbffca | 2018-03-26 16:20:03 -0400 | [diff] [blame] | 42 | - name: The replicated registry filesystem is mounted |
| 43 | mount: |
| 44 | path: "{{ target_voltha_dir }}/registry_data" |
| 45 | src: "{{ inventory_hostname }}:/registry_volume" |
| 46 | fstype: glusterfs |
| 47 | opts: "defaults,_netdev,noauto,x-systemd.automount" |
| 48 | state: mounted |
| 49 | when: target == "cluster" |
| 50 | |
| 51 | - name: The replicated logging filesystem is mounted on boot |
| 52 | mount: |
| 53 | path: "/var/log/voltha" |
| 54 | src: "{{ inventory_hostname }}:/logging_volume" |
| 55 | fstype: glusterfs |
| 56 | opts: "defaults,_netdev,noauto,x-systemd.automount" |
| 57 | state: mounted |
| 58 | when: target == "cluster" |
| 59 | tags: [cluster_host] |