Skip to content

Commit

Permalink
Merge pull request #126 from ccamacho/master
Browse files Browse the repository at this point in the history
fix: fix template indentation
  • Loading branch information
ccamacho authored Dec 9, 2020
2 parents 26a09ab + 3cc2300 commit 13fcd58
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 109 deletions.
2 changes: 1 addition & 1 deletion kubeinit/playbooks/cdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/okd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/rke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/submariner-subctl-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
2 changes: 1 addition & 1 deletion kubeinit/playbooks/submariner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
pre_tasks:
- name: Check if Ansible meets version requirements.
vars:
kubeinit_ansible_min_version: 2.10.3
kubeinit_ansible_min_version: 2.9
assert:
that: "ansible_version.full is version_compare('{{ kubeinit_ansible_min_version }}', '>=')"
msg: >
Expand Down
28 changes: 14 additions & 14 deletions kubeinit/roles/kubeinit_cdk/tasks/50_post_deployment_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['cdk_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt

- name: Remove resolv file
file:
path: /etc/resolv.conf
Expand Down Expand Up @@ -69,7 +56,7 @@
tags:
- provision_libvirt

- name: Restart the ystemd-resolved service
- name: Restart the systemd-resolved service
service:
name: "systemd-resolved"
state: restarted
Expand All @@ -79,3 +66,16 @@
- "{{ groups['all'] | map('regex_search','^((?!hypervisor).)*$') | select('string') | list }}"
tags:
- provision_libvirt

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['cdk_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt
26 changes: 13 additions & 13 deletions kubeinit/roles/kubeinit_eks/tasks/40_post_deployment_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['eks_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt

- name: Copying the kubeconfig to a variable
slurp:
src: ~/.kube/config
Expand Down Expand Up @@ -54,3 +41,16 @@
delegate_to: "{{ groups['eks_service_nodes'][0] }}"
tags:
- provision_libvirt

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['eks_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt
26 changes: 13 additions & 13 deletions kubeinit/roles/kubeinit_k8s/tasks/40_post_deployment_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['k8s_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt

- name: Copying the kubeconfig to a variable
slurp:
src: ~/.kube/config
Expand Down Expand Up @@ -54,3 +41,16 @@
delegate_to: "{{ groups['k8s_service_nodes'][0] }}"
tags:
- provision_libvirt

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['k8s_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt
65 changes: 29 additions & 36 deletions kubeinit/roles/kubeinit_nfs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,32 +96,30 @@
server: {{ hostvars[ groups['all'] | map('regex_search','^.*service.*$') | select('string') | list | first ].ansible_host }}
EOF
cat << EOF > ~/registry_pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: image-registry-pvc
spec:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: image-registry-pvc
spec:
volumeName: image-registry-pv
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
storageClassName: nfs01registry
volumeMode: Filesystem
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5Gi
storageClassName: nfs01registry
volumeMode: Filesystem
EOF
# export KUBECONFIG=~/install_dir/auth/kubeconfig
# oc create -f ~/registry_pv.yaml
# oc create -f ~/registry_pvc.yaml
# We patch the imageregistry operator to use
# the recently created PV by assigning a managed PVC
# oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'
# oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"pvc":{"claim":"image-registry-pvc"}}}}'
# TODO:FIXME: Fails in the CI missing resources
# kubectl apply -f ~/registry_pv.yaml
# TODO:FIXME: Fails in the CI missing resources
# kubectl apply -f ~/registry_pv.yaml
export KUBECONFIG=~/.kube/config
kubectl apply -f ~/registry_pv.yaml
kubectl apply -f ~/registry_pvc.yaml
register: configure_cluster_pv
changed_when: "configure_cluster_pv.rc == 0"
args:
Expand All @@ -132,7 +130,7 @@

- name: add nfs provisioning role
shell: |
cat << EOF > ~/nfs-rbac.yaml
cat << EOF > ~/nfs_rbac.yaml
kind: ServiceAccount
apiVersion: v1
metadata:
Expand Down Expand Up @@ -192,17 +190,16 @@
name: leader-locking-nfs-client-provisioner
apiGroup: rbac.authorization.k8s.io
EOF
export KUBECONFIG=~/install_dir/auth/kubeconfig
# TODO:FIXME: Fails in the CI missing resources
# kubectl apply -f ~/nfs-rbac.yaml
export KUBECONFIG=~/.kube/config
kubectl apply -f ~/nfs_rbac.yaml
register: add_provisioning_role
changed_when: "add_provisioning_role.rc == 0"
args:
executable: /bin/bash

- name: add nfs client provisioner deployment
shell: |
cat << EOF > ~/nfs-client-prov-deployment.yaml
cat << EOF > ~/nfs_client_prov_deployment.yaml
kind: Deployment
apiVersion: apps/v1
metadata:
Expand Down Expand Up @@ -239,17 +236,16 @@
server: {{ hostvars[ groups['all'] | map('regex_search','^.*service.*$') | select('string') | list | first ].ansible_host }}
path: /var/nfsshare
EOF
export KUBECONFIG=~/install_dir/auth/kubeconfig
# TODO:FIXME: Fails in the CI missing resources
# kubectl apply -f ~/nfs-client-prov-deployment.yaml
export KUBECONFIG=~/.kube/config
kubectl apply -f ~/nfs_client_prov_deployment.yaml
register: add_provisioning_client
changed_when: "add_provisioning_client.rc == 0"
args:
executable: /bin/bash

- name: add default nfs storage class
shell: |
cat << EOF > ~/nfs-storage-class.yaml
cat << EOF > ~/nfs_storage_class.yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
Expand All @@ -260,17 +256,16 @@
parameters:
archiveOnDelete: "false"
EOF
export KUBECONFIG=~/install_dir/auth/kubeconfig
# TODO:FIXME: Fails in the CI missing resources
# kubectl apply -f ~/nfs-storage-class.yaml
export KUBECONFIG=~/.kube/config
kubectl apply -f ~/nfs_storage_class.yaml
register: add_storage_class
changed_when: "add_storage_class.rc == 0"
args:
executable: /bin/bash

- name: add security context constraint for nfs provisioner
shell: |
cat << EOF > ~/nfs-scc.yaml
cat << EOF > ~/nfs_scc.yaml
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
Expand Down Expand Up @@ -308,9 +303,8 @@
- persistentVolumeClaim
- secret
EOF
export KUBECONFIG=~/install_dir/auth/kubeconfig
# TODO:FIXME: Fails in the CI missing resources
# oc create -f ~/nfs-scc.yaml
export KUBECONFIG=~/.kube/config
kubectl apply -f ~/nfs_scc.yaml
register: add_sec_context
changed_when: "add_sec_context.rc == 0"
when: kubeinit_inventory_cluster_distro == 'okd'
Expand All @@ -319,9 +313,8 @@

- name: apply nfs security policy to nfs user
shell: |
export KUBECONFIG=~/install_dir/auth/kubeconfig
# TODO:FIXME: Fails in the CI missing resources
# oc adm policy add-scc-to-user nfs-provisioner -z nfs-client-provisioner
export KUBECONFIG=~/.kube/config
oc adm policy add-scc-to-user nfs-provisioner -z nfs-client-provisioner
register: apply_nfs_sec
changed_when: "apply_nfs_sec.rc == 0"
when: kubeinit_inventory_cluster_distro == 'okd'
Expand Down
26 changes: 13 additions & 13 deletions kubeinit/roles/kubeinit_okd/tasks/30_post_deployment_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,6 @@
tags:
- provision_libvirt

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['okd_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt

# This can take a lot of time until the cluster converges
- name: Wait for installer to complete
command: openshift-install --dir=install_dir/ wait-for install-complete --log-level info
Expand Down Expand Up @@ -196,6 +183,19 @@
tags:
- provision_libvirt

#
# Configure NFS
#

- name: Configure NFS
delegate_to: "{{ groups['okd_service_nodes'][0] }}"
# delegate_facts: true
import_role:
name: ../../roles/kubeinit_nfs
tasks_from: main
tags:
- provision_libvirt

- name: Display final debug info
debug:
var: final_output_info
Expand Down
Loading

0 comments on commit 13fcd58

Please sign in to comment.