diff --git a/04_pg95db/ansible/01_prepare_nodes.yaml b/04_pg95db/ansible/01_prepare_nodes.yaml new file mode 120000 index 0000000..36ecbd8 --- /dev/null +++ b/04_pg95db/ansible/01_prepare_nodes.yaml @@ -0,0 +1 @@ +../../99_newhost/ansible/01_prepare_nodes.yaml \ No newline at end of file diff --git a/04_pg95db/ansible/include/_setup_vars.yaml b/04_pg95db/ansible/include/_setup_vars.yaml new file mode 100644 index 0000000..611c030 --- /dev/null +++ b/04_pg95db/ansible/include/_setup_vars.yaml @@ -0,0 +1,29 @@ +- name: Set global variables + set_fact: + virbr: "8" + netsuffix: "26" + hostname: "pgdb95" + domain: "lab.local" + mem: "4G" + ipaserver: "freeipa.lab.local" + ipaip: "10.1.8.10" + ldapbase: "dc=lab,dc=local" + svcadmin: "admin" + adminpwd: "admin123" + template: "t_centos7" + template_dir: "/data/templates" + vms_dir: "/data/vms" + +- name: Set ip + set_fact: + ip: "10.1.{{ virbr }}.{{ netsuffix }}" + + + +- name: Set FQDN + set_fact: + fqdn: "{{ hostname }}.{{ domain }}" + +- name: Set REALM + set_fact: + realm: "{{ domain|upper }}" diff --git a/06_registry/ansible/02_install_registry.yaml b/06_registry/ansible/02_install_registry.yaml index d5ebb9d..946310b 100644 --- a/06_registry/ansible/02_install_registry.yaml +++ b/06_registry/ansible/02_install_registry.yaml @@ -102,4 +102,5 @@ -e REGISTRY_HTTP_ADDR=0.0.0.0:443 \ -e REGISTRY_HTTP_TLS_CERTIFICATE=/var/lib/registry/certs/{{ fqdn }}.pem \ -e REGISTRY_HTTP_TLS_KEY=/var/lib/registry/certs/{{ fqdn }}.key \ + -e REGISTRY_STORAGE_DELETE_ENABLED=true \ registry diff --git a/06_registry/scripts/install-ui.sh b/06_registry/scripts/install-ui.sh index cf218ff..b17c829 100644 --- a/06_registry/scripts/install-ui.sh +++ b/06_registry/scripts/install-ui.sh @@ -3,4 +3,4 @@ docker pull jc21/registry-ui:latest docker tag jc21/registry-ui registry.lab.local/openshift/registry-ui:latest docker push registry.lab.local/openshift/registry-ui:latest -docker run -d -it -p 80:80 -e REGISTRY_HOST=registry.lab.local:443 -e REGISTRY_SSL=true -e REGISTRY_DOMAIN=registry.lab.local:443 --name registry-ui registry.lab.local/openshift/registry-ui:latest +docker run -d -it -p 80:80 -e REGISTRY_HOST=registry.lab.local:443 -e REGISTRY_STORAGE_DELETE_ENABLED=true -e REGISTRY_SSL=true -e REGISTRY_DOMAIN=registry.lab.local:443 --name registry-ui registry.lab.local/openshift/registry-ui:latest diff --git a/15_prometheus/02_install_prometheus b/15_prometheus/02_prepare_prometheus.yaml similarity index 59% rename from 15_prometheus/02_install_prometheus rename to 15_prometheus/02_prepare_prometheus.yaml index b14b5ba..e4b3569 100644 --- a/15_prometheus/02_install_prometheus +++ b/15_prometheus/02_prepare_prometheus.yaml @@ -10,11 +10,11 @@ - name: "Create ansible group for new hosts" add_host: name="{{ ip }}" groups=newhost - - name: Create nfs home data disk - shell: qemu-img create -f qcow2 {{ vms_dir }}/{{ fqdn }}/nfsvg.qcow2 {{ disksize }} + - name: Create prometheus data disk + shell: qemu-img create -f qcow2 {{ vms_dir }}/{{ fqdn }}/promvg.qcow2 {{ disksize }} - name: Attach disk to machine - shell: virsh attach-disk {{ fqdn }} --source {{ vms_dir }}/{{ fqdn }}/nfsvg.qcow2 --target vdb --subdriver qcow2 --targetbus virtio --persistent + shell: virsh attach-disk {{ fqdn }} --source {{ vms_dir }}/{{ fqdn }}/promvg.qcow2 --target vdb --subdriver qcow2 --targetbus virtio --persistent - name: Autostart of the machine shell: virsh autostart {{ fqdn }} @@ -28,7 +28,13 @@ include: include/_setup_vars.yaml - name: Setup firewall rules - shell: firewall-cmd --permanent --add-service={mountd,nfs,rpc-bind} ; firewall-cmd --reload + shell: firewall-cmd --permanent --add-port=9090-9094/tcp --add-port=443/tcp ; firewall-cmd --reload + + - name: LV extend /lv-var + shell: lvresize /dev/rootvg/var -L+10G + + - name: Resize fs + shell: resize2fs /dev/rootvg/var - name: Create datavg and logical volume shell: pvcreate /dev/vdb ; vgcreate promvg /dev/vdb ; lvcreate -n data -L50G promvg @@ -39,8 +45,8 @@ - name: make directory /prometheus/data shell: mkdir -p /prometheus/data - - name: Add /nfshome to fstab - shell: echo '/dev/mapper/prometheus-data /prometheus/data ext4 noatime,nodiratime 1 2' >> /etc/fstab + - name: Add /prometheus/data to fstab + shell: echo '/dev/mapper/promvg-data /prometheus/data ext4 noatime,nodiratime 1 2' >> /etc/fstab - name: Mount /prometheus/data shell: mount /prometheus/data diff --git a/15_prometheus/03_extend_cluster.yaml b/15_prometheus/03_extend_cluster.yaml new file mode 100644 index 0000000..31e5639 --- /dev/null +++ b/15_prometheus/03_extend_cluster.yaml @@ -0,0 +1,37 @@ +--- +- hosts: localhost + become: true + gather_facts: no + tasks: + + - name: Set variables + include: include/_setup_vars.yaml + + - name: "Create ansible group for new hosts" + add_host: name="{{ master }}" groups=newhost + +- hosts: newhost + become: true + gather_facts: no + tasks: + + - name: Set variables + include: include/_setup_vars.yaml + + - name: Copy cluster.ini + shell: cp /root/gshipley/cluster.ini /root/gshipley/prometheus.ini + + - name: Add new hosts + shell: echo "[new_nodes]" >> /root/gshipley/prometheus.ini ; echo "{{ fqdn }} openshift_node_group_name='node-config-prometheus'" >> /root/gshipley/prometheus.ini + + - name: Add section new nodes + shell: cd /root/gshipley ; sed -i -E 's/nodes$/nodes\nnew_nodes/' prometheus.ini + + - name: Add host to ansible host + shell: echo "{{ fqdn }}" >> /etc/ansible/hosts + + - name: setting up the node group + shell: cd /root/gshipley ; ansible-playbook -i prometheus.ini openshift-ansible/playbooks/openshift-master/openshift_node_group.yml + + - name: Add new node to the cluster + shell: cd /root/gshipley ; ansible-playbook -i prometheus.ini openshift-ansible/playbooks/openshift-node/scaleup.yml diff --git a/15_prometheus/README.md b/15_prometheus/README.md new file mode 100644 index 0000000..e69de29 diff --git a/15_prometheus/include/_setup_vars.yaml b/15_prometheus/include/_setup_vars.yaml index 5518de7..bade799 100644 --- a/15_prometheus/include/_setup_vars.yaml +++ b/15_prometheus/include/_setup_vars.yaml @@ -33,3 +33,7 @@ - name: Set disksize set_fact: disksize: "51G" + +- name: Set ocp master + set_fact: + master: "node11.lab.local"