Hyunsun Moon | e484834 | 2020-02-16 04:28:55 -0800 | [diff] [blame] | 1 | # Copyright 2020-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. |
| 14 | |
| 15 | --- |
| 16 | # Check ansible version |
| 17 | - hosts: localhost |
| 18 | become: no |
| 19 | gather_facts: False |
| 20 | tasks: |
| 21 | - name: "Check ansible version ==2.9.5" |
| 22 | assert: |
| 23 | msg: "Ansible must be v2.9.5" |
| 24 | that: |
| 25 | - ansible_version.string is version("2.9.5", "==") |
| 26 | vars: |
| 27 | ansible_connection: local |
| 28 | |
| 29 | - hosts: kube-master:kube-worker |
| 30 | vars_prompt: |
| 31 | name: "reset_confirmation" |
| 32 | prompt: "Are you sure you want to reset cluster state? Type 'yes' to reset your cluster." |
| 33 | default: "no" |
| 34 | private: no |
| 35 | |
| 36 | pre_tasks: |
| 37 | - name: check confirmation |
| 38 | fail: |
| 39 | msg: "Reset confirmation failed" |
| 40 | when: reset_confirmation != "yes" |
| 41 | |
| 42 | roles: |
| 43 | - { role: reset } |