openstack-helm-infra/roles/deploy-kubeadm-aio-common/tasks/clean-node.yaml
Andrii Ostapenko 8f24a74bc7 Introduces templates linting
This commit rewrites lint job to make template linting available.
Currently yamllint is run in warning mode against all templates
rendered with default values. Duplicates detected and issues will be
addressed in subsequent commits.

Also all y*ml files are added for linting and corresponding code changes
are made. For non-templates warning rules are disabled to improve
readability. Chart and requirements yamls are also modified in the name
of consistency.

Change-Id: Ife6727c5721a00c65902340d95b7edb0a9c77365
2020-06-11 23:29:42 -05:00

70 lines
2.3 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: master
vars:
kubeadm_aio_action: clean-host
block:
- name: "kubeadm-aio performing action: {{ kubeadm_aio_action }}"
become: true
become_user: root
docker_container:
name: "kubeadm-{{ kubeadm_aio_action }}"
image: "{{ images.kubernetes.kubeadm_aio }}"
state: started
detach: false
recreate: yes
pid_mode: host
network_mode: host
capabilities: SYS_ADMIN
volumes:
- /sys:/sys:rw
- /run:/run:rw
- /:/mnt/rootfs:rw
- /etc:/etc:rw
env:
CONTAINER_NAME="kubeadm-{{ kubeadm_aio_action }}"
ACTION="{{ kubeadm_aio_action }}"
KUBE_BIND_DEVICE="{{ kubernetes_default_device }}"
USER_UID="{{ playbook_user_id }}"
USER_GID="{{ playbook_group_id }}"
USER_HOME="{{ playbook_user_dir }}"
CNI_ENABLED="{{ kubernetes_cluster_cni }}"
PVC_SUPPORT_CEPH=true
PVC_SUPPORT_NFS=true
NET_SUPPORT_LINUXBRIDGE=true
KUBE_NET_POD_SUBNET="{{ kubernetes_cluster_pod_subnet }}"
KUBE_NET_DNS_DOMAIN="{{ kubernetes_cluster_domain }}"
CONTAINER_RUNTIME=docker
register: kubeadm_master_deploy
ignore_errors: True
rescue:
- name: getting logs from kubeadm-aio container
command: "docker logs kubeadm-{{ kubeadm_aio_action }}"
become: true
become_user: root
register: out
- name: dumping logs from kubeadm-aio container
debug:
var: out.stdout_lines
- name: exiting if the kubeadm deploy failed
command: exit 1
always:
- name: removing kubeadm-aio container
become: true
become_user: root
docker_container:
name: "kubeadm-{{ kubeadm_aio_action }}"
state: absent
...