├── .gitignore ├── LICENSE ├── README.md ├── TIPS.md ├── api ├── hello.py └── hello.pyc ├── cPodFactory.png ├── compute ├── cpod-xxx_env ├── cpod_ip.sh ├── create_vapp.ps1 ├── create_vapp.sh ├── delete_vapp.ps1 ├── delete_vapp.sh ├── deploy_filer.ps1 ├── deploy_filer.sh ├── list_cpod.sh ├── list_datacenter.sh ├── list_portgroup.sh ├── list_vapp.ps1 ├── list_vapp.sh ├── mac_learning │ ├── modify_portgroup.ps1 │ └── modify_portgroup.sh ├── modify_portgroup.ps1 ├── modify_portgroup.sh ├── prep_and_add_esx.sh ├── prep_vcsa.ps1 ├── prep_vcsa.ps1-bkp ├── prep_vcsa.sh ├── prep_vcsa.sh-bkp ├── promiscuous │ ├── modify_portgroup.ps1 │ └── modify_portgroup.sh ├── psc-65.json ├── put_esx_maintenance_mode.ps1 ├── put_esx_maintenance_mode.sh ├── remove_orphaned.ps1 ├── remove_orphaned.sh ├── save-cpod-xxx_env ├── session_vcenter.sh ├── start_vapp.ps1 ├── start_vapp.sh ├── stop_vapp.ps1 ├── stop_vapp.sh ├── vcsa-65.json ├── vcsa-65.json-psc-small ├── vcsa-67.json └── wait_ip.sh ├── cpod_lease.sh ├── cpod_lease.sh-bckp ├── cpodctl ├── cpodctl-completion.sh ├── create_cpod.sh ├── delete_cpod.sh ├── enter_maintenance_cpod.sh ├── env ├── env-dell ├── env-hp ├── env-intel ├── env.passwd-template ├── expose_cpod.sh ├── extra ├── add_filer.sh ├── check_datastore.sh ├── check_space.sh ├── clean_ssh.sh ├── delete_photonos_cday.ps1 ├── delete_photonos_cday_pcli.sh ├── deploy_darkstar.sh ├── deploy_fortytwo.sh ├── deploy_gracehoper.sh ├── deploy_hci.sh ├── deploy_jumpbox.sh ├── deploy_nsx-t │ ├── 1-install_nsx.sh │ ├── 2-activate_nsx_cluster.sh │ ├── 3-configure_nsx.sh │ ├── 99-cleanup.sh │ ├── README.md │ ├── README_2.md │ ├── README_3.md │ ├── all-install_activate_configure_nsx.sh │ ├── configure_nsx.env │ ├── delete_nsx.env │ └── install_nsx.env ├── deploy_nsx-v.sh ├── deploy_opsmanager-2.sh ├── deploy_opsmanager.sh ├── deploy_photonos.sh ├── deploy_photonos_cday.ps1 ├── deploy_photonos_cday.sh ├── deploy_photonos_cday_mail.sh ├── deploy_photonos_cday_pcli.sh ├── deploy_photonos_cday_users.sh ├── deploy_rift.sh ├── deploy_ubuntu.sh ├── deploy_vcsa.sh ├── deploy_vcsa.sh-bkp ├── deploy_vic.sh ├── deploy_vio-k8s.sh ├── deploy_vio.sh ├── deploy_vrli.sh ├── deploy_vrops.sh ├── gen_passwd.sh ├── leases │ └── leases.txt ├── migrate-vm.ps1 ├── passgen.sh ├── passwd_for_cpod.sh ├── petname.sh ├── post_slack.sh-template ├── pwgen ├── receive_file.sh ├── send_file.sh └── update_cpodegde.sh ├── govc_env-example ├── info_shwrfr.sh ├── install ├── 1-update.sh ├── acme.sh │ ├── account.conf │ ├── acme.sh │ ├── acme.sh.env │ ├── acme.sh.log │ ├── ca │ │ ├── acme-staging.api.letsencrypt.org │ │ │ ├── account.json │ │ │ ├── account.key │ │ │ └── ca.conf │ │ └── acme-v01.api.letsencrypt.org │ │ │ ├── account.json │ │ │ ├── account.key │ │ │ └── ca.conf │ ├── deploy │ │ ├── README.md │ │ ├── apache.sh │ │ ├── cpanel_uapi.sh │ │ ├── dovecot.sh │ │ ├── exim4.sh │ │ ├── fritzbox.sh │ │ ├── haproxy.sh │ │ ├── keychain.sh │ │ ├── kong.sh │ │ ├── myapi.sh │ │ ├── mysqld.sh │ │ ├── nginx.sh │ │ ├── opensshd.sh │ │ ├── pureftpd.sh │ │ ├── strongswan.sh │ │ ├── unifi.sh │ │ └── vsftpd.sh │ ├── dnsapi │ │ ├── README.md │ │ ├── dns_ad.sh │ │ ├── dns_ali.sh │ │ ├── dns_aws.sh │ │ ├── dns_cf.sh │ │ ├── dns_cloudns.sh │ │ ├── dns_cx.sh │ │ ├── dns_cyon.sh │ │ ├── dns_dgon.sh │ │ ├── dns_dnsimple.sh │ │ ├── dns_do.sh │ │ ├── dns_dp.sh │ │ ├── dns_duckdns.sh │ │ ├── dns_dyn.sh │ │ ├── dns_dynu.sh │ │ ├── dns_freedns.sh │ │ ├── dns_gandi_livedns.sh │ │ ├── dns_gd.sh │ │ ├── dns_he.sh │ │ ├── dns_infoblox.sh │ │ ├── dns_inwx.sh │ │ ├── dns_ispconfig.sh │ │ ├── dns_knot.sh │ │ ├── dns_lexicon.sh │ │ ├── dns_linode.sh │ │ ├── dns_lua.sh │ │ ├── dns_me.sh │ │ ├── dns_myapi.sh │ │ ├── dns_namecom.sh │ │ ├── dns_nsone.sh │ │ ├── dns_nsupdate.sh │ │ ├── dns_ovh.sh │ │ ├── dns_pdns.sh │ │ ├── dns_servercow.sh │ │ ├── dns_unoeuro.sh │ │ ├── dns_vscale.sh │ │ └── dns_yandex.sh │ ├── fullchain.pem │ ├── http.header │ ├── issue.sh │ ├── privkey.pem │ └── renewal.sh ├── at-package │ ├── at-3.1.23 │ │ ├── .gitignore │ │ ├── COPYING │ │ ├── ChangeLog │ │ ├── Copyright │ │ ├── Makefile.in │ │ ├── Problems │ │ ├── README │ │ ├── at.1.in │ │ ├── at.allow.5.in │ │ ├── at.c │ │ ├── at.deny │ │ ├── at.h │ │ ├── atd.8.in │ │ ├── atd.c │ │ ├── atd.service.in │ │ ├── atrun.8.in │ │ ├── atrun.in │ │ ├── batch.in │ │ ├── config.guess │ │ ├── config.h.in │ │ ├── config.log │ │ ├── config.sub │ │ ├── configure │ │ ├── configure.ac │ │ ├── daemon.c │ │ ├── daemon.h │ │ ├── dist │ │ ├── getloadavg.c │ │ ├── getloadavg.h │ │ ├── install-sh │ │ ├── pam.conf │ │ ├── panic.c │ │ ├── panic.h │ │ ├── parsetime.h │ │ ├── parsetime.l │ │ ├── parsetime.pl │ │ ├── parsetime.y │ │ ├── perm.c │ │ ├── perm.h │ │ ├── posixtm.c │ │ ├── posixtm.h │ │ ├── privs.h │ │ ├── rc │ │ ├── release │ │ └── timespec │ └── at_3.1.23.orig.tar.gz ├── containers │ ├── docker-elasticsearch │ │ ├── Dockerfile │ │ ├── Makefile │ │ └── README.md │ ├── docker-grafana │ │ ├── Dockerfile │ │ ├── Makefile │ │ └── README.md │ ├── docker-haproxy │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── haproxy │ │ │ ├── conf │ │ │ │ ├── errors │ │ │ │ │ ├── 400.http │ │ │ │ │ ├── 403.http │ │ │ │ │ ├── 408.http │ │ │ │ │ ├── 500.http │ │ │ │ │ ├── 502.http │ │ │ │ │ ├── 503.http │ │ │ │ │ └── 504.http │ │ │ │ └── haproxy.cfg │ │ │ └── html │ │ │ │ ├── index.html │ │ │ │ └── owncloud │ │ │ │ └── index.html │ │ ├── startup.sh │ │ └── update-pem.sh │ ├── docker-node-exporter │ │ ├── Dockerfile │ │ ├── Makefile │ │ └── README.md │ ├── docker-openvpn │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── generate-conf.sh │ │ ├── openvpn │ │ │ ├── ccd │ │ │ │ └── client │ │ │ ├── easy-rsa │ │ │ │ ├── build-ca │ │ │ │ ├── build-dh │ │ │ │ ├── build-inter │ │ │ │ ├── build-key │ │ │ │ ├── build-key-pass │ │ │ │ ├── build-key-pkcs12 │ │ │ │ ├── build-key-server │ │ │ │ ├── build-req │ │ │ │ ├── build-req-pass │ │ │ │ ├── clean-all │ │ │ │ ├── inherit-inter │ │ │ │ ├── list-crl │ │ │ │ ├── openssl-0.9.6.cnf │ │ │ │ ├── openssl-0.9.8.cnf │ │ │ │ ├── openssl-1.0.0.cnf │ │ │ │ ├── pkitool │ │ │ │ ├── revoke-full │ │ │ │ ├── shwrfr-env.sh │ │ │ │ ├── sign-req │ │ │ │ ├── vars │ │ │ │ └── whichopensslcnf │ │ │ ├── make-client.sh │ │ │ ├── openssl.cnf │ │ │ ├── server.conf │ │ │ ├── server.conf-az-demo │ │ │ ├── server.conf-az-demo-bkp │ │ │ ├── server.conf-az-lab │ │ │ ├── server.conf-az-lab-bkp │ │ │ ├── server.conf-bkp │ │ │ ├── server.conf-template │ │ │ ├── shwrfr-tunnelblick-client.tgz │ │ │ ├── update-resolv-conf │ │ │ └── update-resolv-conf-orig │ │ └── startup.sh │ ├── docker-prometheus │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ └── prometheus.yml │ ├── docker-strongswan │ │ ├── Dockerfile │ │ ├── Makefile │ │ ├── README.md │ │ ├── config │ │ │ ├── ipsec.conf │ │ │ ├── ipsec.conf-bkp │ │ │ ├── ipsec.conf-orig │ │ │ ├── ipsec.d │ │ │ │ ├── clientCert.p12 │ │ │ │ └── firewall.updown │ │ │ ├── ipsec.secrets │ │ │ ├── ipsec.secrets-bkp │ │ │ ├── ipsec.secrets-orig │ │ │ └── strongswan.conf │ │ └── generate_certs.sh │ └── docker-syncthing │ │ ├── Dockerfile │ │ ├── Makefile │ │ └── README.md ├── etc │ ├── dnsmasq.conf │ ├── hosts │ ├── motd │ ├── ntp.conf │ ├── quagga │ │ └── bgpd.conf │ └── ssh_config ├── gen-motd-cpodbuild.sh ├── gen-motd-cpodedge-rainbow-2.sh ├── gen-motd-cpodedge-rainbow.sh ├── gen-motd-cpodedge.sh ├── gen-motd-cpodfiler.sh ├── gen-motd-cpodrouter.sh ├── html │ ├── 50x.html │ ├── LICENSE.txt │ ├── assets │ │ ├── css │ │ │ ├── font-awesome.min.css │ │ │ ├── ie9.css │ │ │ ├── main.css │ │ │ ├── noscript.css │ │ │ └── skull.css │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── js │ │ │ ├── jquery.min.js │ │ │ ├── main.js │ │ │ ├── skel.min.js │ │ │ └── util.js │ │ └── sass │ │ │ ├── base │ │ │ ├── _page.scss │ │ │ └── _typography.scss │ │ │ ├── components │ │ │ ├── _box.scss │ │ │ ├── _button.scss │ │ │ ├── _form.scss │ │ │ ├── _icon.scss │ │ │ ├── _image.scss │ │ │ ├── _list.scss │ │ │ └── _table.scss │ │ │ ├── ie9.scss │ │ │ ├── layout │ │ │ ├── _bg.scss │ │ │ ├── _footer.scss │ │ │ ├── _header.scss │ │ │ ├── _main.scss │ │ │ └── _wrapper.scss │ │ │ ├── libs │ │ │ ├── _functions.scss │ │ │ ├── _mixins.scss │ │ │ ├── _skel.scss │ │ │ └── _vars.scss │ │ │ ├── main.scss │ │ │ └── noscript.scss │ ├── images │ │ ├── R630comp_front.jpg │ │ ├── bg.jpg │ │ ├── logo.png │ │ ├── overlay.png │ │ ├── pic01.jpg │ │ ├── pic02.jpg │ │ ├── pic03.jpg │ │ ├── shwrfr.png │ │ ├── skull-tr.png │ │ ├── skull.png │ │ └── vmware.png │ ├── index-ref.html │ ├── index-site.htm-bkp │ ├── index-site.html │ ├── index.html │ ├── index.html-old │ ├── index.html-orig │ ├── index2.html │ ├── index3.html │ ├── index_bkp_300118.html │ ├── skull.css │ ├── skull.html │ └── slack │ │ ├── add_filer.php │ │ ├── add_filer.sh │ │ ├── archive │ │ ├── mise_en_prodV2.php │ │ ├── trigger_pipeline.sh │ │ └── trigger_pipeline.sh.bak │ │ ├── check_cpod.sh │ │ ├── cpodctl.php │ │ ├── create_cpod.php │ │ ├── create_cpod.sh │ │ ├── delete_cpod.php │ │ ├── delete_cpod.sh │ │ ├── deploy_vcsa.php │ │ ├── deploy_vcsa.sh │ │ ├── licensing_cpod.php │ │ ├── licensing_cpod.sh │ │ ├── list_cpod.php │ │ ├── list_cpod.sh │ │ ├── list_cpod.sh-vcsa │ │ ├── log │ │ ├── mise_en_prod.php │ │ ├── mise_en_prod.sh │ │ ├── nohup.out │ │ ├── password_cpod.php │ │ ├── password_cpod.sh │ │ ├── start_cpod.php │ │ ├── start_cpod.sh │ │ ├── status_shwrfr.php │ │ ├── status_shwrfr.sh │ │ ├── test.php │ │ ├── token.php-example │ │ ├── trigger_pipeline_saasV2.sh │ │ ├── wiki_cpod.php │ │ └── wiki_cpod.sh ├── motd ├── multiplex-reverseproxy-isolation │ ├── cPodEdge │ │ ├── iptables.cpod-isolation │ │ ├── rc-local.service │ │ └── rc.local │ └── cPodRouter │ │ ├── haproxy.cfg │ │ ├── iptables │ │ ├── iptables-bkp │ │ ├── nginx.conf │ │ ├── snippets │ │ └── ssl-params.conf │ │ └── ssl │ │ └── shwrfr.com │ │ ├── shwrfr.com.conf │ │ └── shwrfr.com.csr.conf ├── network │ ├── eth0-static.network │ ├── eth1-static.network │ └── eth2-static.network ├── photon.png ├── pxe │ └── dnsmasq.conf ├── sbin │ ├── bgpd │ ├── govc │ ├── iftop │ ├── libreadline.so.6 │ ├── libzebra.so │ ├── pwgen │ ├── vtysh │ └── zebra └── systemd │ ├── backup.service │ ├── backup.timer │ ├── bgpd.service │ ├── docker-container@haproxy.service │ ├── docker-container@openvpn-udp.service │ ├── docker-container@openvpn.service │ ├── docker-container@syncthing.service │ ├── iptables │ ├── iptables-az-demo │ ├── iptables.cpod-isolation │ ├── rc-local.service │ └── zebra.service ├── licensing_cpod.sh ├── list_cpod.sh ├── list_cpod_bgp_peering.sh ├── network ├── add_bgp_neighbour.sh ├── add_bgp_peer_vtysh.sh ├── create_logicalswitch.sh ├── delete_bgp_neighbour.sh ├── delete_bgp_peer_vtysh.sh ├── delete_ip_pool.sh ├── delete_logicalswitch.sh ├── delete_pool.sh ├── get_bgp.sh ├── get_routing.sh ├── id_transportzone.sh ├── list_dvs.sh ├── list_ip_pool.sh ├── list_logicalswitch.sh ├── list_pool.sh ├── list_transportzone.sh ├── props_dvs.sh ├── props_logicialswitch.sh ├── put_bgp.sh ├── put_routing.sh └── update_dvs_mtu.sh ├── password_cpod.sh ├── prep_cpod.sh ├── save-env-intel ├── slack_motd.sh ├── slack_motd.txt ├── smoke_test.sh ├── status_shwrfr.sh ├── update_network.sh └── update_network_cpodrouter.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.passwd 2 | lock 3 | extra/post_slack.sh 4 | install/containers/docker-openvpn/openvpn/easy-rsa/keys/* 5 | install/containers/docker-openvpn-udp/openvpn/easy-rsa/keys/* 6 | install/containers/docker-openvpn/openvpn/clients/* 7 | install/containers/docker-openvpn-udp/openvpn/clients/* 8 | install/containers/docker-haproxy/haproxy/conf/cpodedge.pem 9 | ovftool.tgz 10 | ovftool/* 11 | options 12 | govc_env 13 | licenses.key 14 | token.php 15 | backup/* 16 | *.pem 17 | *.key 18 | *.csr 19 | *.cer 20 | *.crt 21 | install/nginx-reverseproxy/ssl/shwrfr.com/shwrfr.com.conf 22 | public-ip 23 | extra/leases/* 24 | ipsec.secrets* 25 | install/containers/docker-strongswan/config/ipsec.d/* 26 | install/containers/docker-strongswan/config/ipsec.secrets 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Brice Dereims 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cPod Factory 2 | Lab Automation in nested VMware SDDC with ludicrous speed. 3 | Like a Russian Dolls for vSDDC. 4 | 5 | ![TheWhy](https://github.com/bdereims/cPodFactory/blob/master/cPodFactory.png) 6 | 7 | Some links to bootstrap your env with download:\ 8 | [Container used for executing powercli if you are airgapped](https://bucket-garage.s3.eu-central-1.amazonaws.com/powercli-container.tar.gz)\ 9 | [cPodEdge OVA](https://bucket-garage.s3.eu-central-1.amazonaws.com/template-cPodEdge-20200909.ova)\ 10 | [cPodRouter OVA](https://bucket-garage.s3.eu-central-1.amazonaws.com/template-cPodRouter-20200909.ova)\ 11 | [ESX70 template with trial license](https://bucket-garage.s3.eu-central-1.amazonaws.com/template-ESX70U2a.ova)\ 12 | [FORTY-TWO template - a ubuntu jumpbox](https://bucket-garage.s3.eu-central-1.amazonaws.com/template-FORTY-TWO.ova) 13 | 14 | 15 | Powered by vSphere. Don't use it for production environment. 16 | 17 | The solely purpose is labs. 18 | 19 | Check out the [LICENSE](https://github.com/bdereims/cPodFactory/blob/master/LICENSE) 20 | -------------------------------------------------------------------------------- /TIPS.md: -------------------------------------------------------------------------------- 1 | # Nested VSAN 2 | 3 | all all physical ESXi run this command: 4 | '''esxcli system settings advanced set -o /VSAN/FakeSCSIReservations -i 1''' 5 | -------------------------------------------------------------------------------- /api/hello.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | from fabric.operations import local 3 | app = Flask(__name__) 4 | 5 | @app.route("/") 6 | def hello(): 7 | result = local('ip route | sed -e "s/ via.*//g" -e "s/ dev.*//g"', capture=True).split(' ') 8 | return('\n'.join(result)) 9 | 10 | app.run(host='0.0.0.0') 11 | -------------------------------------------------------------------------------- /api/hello.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/api/hello.pyc -------------------------------------------------------------------------------- /cPodFactory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/cPodFactory.png -------------------------------------------------------------------------------- /compute/cpod_ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "${1}" == "" ] && echo "usage: ${0} CPOD-NAME" && exit 1 7 | 8 | DNSMASQ=/etc/dnsmasq.conf 9 | CPOD_L=$( echo ${1} | tr '[:upper:]' '[:lower:]' ) 10 | CPOD_H=$( echo ${1} | tr '[:lower:]' '[:upper:]' ) 11 | 12 | CONF=$( grep "cpod-${CPOD_L}." ${DNSMASQ} ) 13 | [ $? -ne 0 ] && echo "error: cPod ${1} not found!" && exit 1 14 | 15 | TRANSIT_IP=$( echo ${CONF} | sed 's!^.*/!!' | sort | tail -n 1 ) 16 | 17 | TMP=$( echo ${TRANSIT_IP} | sed 's/.*\.//' ) 18 | TMP=$( expr $TMP - 10 ) 19 | 20 | echo "${TRANSIT}.${TMP}" 21 | -------------------------------------------------------------------------------- /compute/create_vapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | # $2 : PortGroup Name 6 | # $3 : @IP 7 | # $4 : # of ESX 8 | # $5 : Root Domain 9 | 10 | . ./env 11 | 12 | [ "$1" == "" -o "$2" == "" -o "$3" == "" ] && echo "usage: $0 " && exit 1 13 | 14 | PS_SCRIPT=create_vapp.ps1 15 | 16 | SCRIPT_DIR=/tmp/scripts 17 | SCRIPT=/tmp/scripts/$$.ps1 18 | 19 | mkdir -p ${SCRIPT_DIR} 20 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 21 | 22 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 23 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 24 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 25 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 26 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 27 | -e "s/###PORTGROUP###/${2}/" \ 28 | -e "s/###CPOD_NAME###/${1}/" \ 29 | -e "s/###TEMPLATE_VM###/${TEMPLATE_VM}/" \ 30 | -e "s/###TEMPLATE_ESX###/${TEMPLATE_ESX}/" \ 31 | -e "s/###IP###/${3}/" \ 32 | -e "s/###ROOT_PASSWD###/${ROOT_PASSWD}/" \ 33 | -e "s/###DATASTORE###/${DATASTORE}/" \ 34 | -e "s/###NUMESX###/${4}/" \ 35 | -e "s/###ROOT_DOMAIN###/${5}/" \ 36 | -e "s/###ASN###/${ASN}/" \ 37 | ${SCRIPT} 38 | 39 | echo "Creating vApp '${HEADER}-${1}' with ${4} ESXi." 40 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v /tmp/scripts:/tmp/scripts vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/null 41 | 42 | rm -fr ${SCRIPT} 43 | -------------------------------------------------------------------------------- /compute/delete_vapp.ps1: -------------------------------------------------------------------------------- 1 | #Delete vApp 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = "###VCENTER_PASSWD###" 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $cPodName = "###CPOD_NAME###" 10 | 11 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 12 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 13 | 14 | $VApp = Get-VApp -Name cPod-$cPodName -Location ( Get-Datacenter -Name $Datacenter ) 15 | Stop-VApp -Force -VApp $VApp -Confirm:$false 16 | Remove-VApp -VApp $VApp -Confirm:$false -DeletePermanently:$true 17 | 18 | Disconnect-VIServer -Confirm:$false 19 | -------------------------------------------------------------------------------- /compute/delete_vapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | PS_SCRIPT=delete_vapp.ps1 11 | 12 | SCRIPT_DIR=/tmp/scripts 13 | SCRIPT=/tmp/scripts/$$.ps1 14 | 15 | mkdir -p ${SCRIPT_DIR} 16 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 17 | 18 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 19 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 20 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 21 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 22 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 23 | -e "s/###CPOD_NAME###/${1}/" \ 24 | ${SCRIPT} 25 | 26 | echo "Deleting vApp '${HEADER}-${1}'." 27 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/null 28 | 29 | rm -fr ${SCRIPT} 30 | -------------------------------------------------------------------------------- /compute/deploy_filer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | PS_SCRIPT=deploy_filer.ps1 11 | 12 | SCRIPT_DIR=/tmp/scripts 13 | SCRIPT=/tmp/scripts/$$.ps1 14 | 15 | mkdir -p ${SCRIPT_DIR} 16 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 17 | 18 | IP=$( ${COMPUTE_DIR}/cpod_ip.sh ${1} ) 19 | IP="${IP}.2" 20 | GEN_PASSWD=$( ${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 21 | 22 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 23 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 24 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 25 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 26 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 27 | -e "s/###PORTGROUP###/${2}/" \ 28 | -e "s/###CPOD_NAME###/${1}/" \ 29 | -e "s/###TEMPLATE_FILER###/${TEMPLATE_FILER}/" \ 30 | -e "s/###IP###/${IP}/" \ 31 | -e "s/###ROOT_PASSWD###/${ROOT_PASSWD}/" \ 32 | -e "s/###DATASTORE###/${DATASTORE}/" \ 33 | -e "s/###ROOT_DOMAIN###/${3}/" \ 34 | -e "s/###GEN_PASSWD###/${GEN_PASSWD}/" \ 35 | ${SCRIPT} 36 | 37 | echo "Cloning cPodFiler VM to '${HEADER}-${1}'." 38 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v /tmp/scripts:/tmp/scripts vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/null 39 | 40 | rm -fr ${SCRIPT} 41 | -------------------------------------------------------------------------------- /compute/list_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | DNSMASQ=/etc/dnsmasq.conf 7 | 8 | cat ${DNSMASQ} | grep cpod | cut -f 2 -d '/' | sed "s/\..*$//" 9 | -------------------------------------------------------------------------------- /compute/list_datacenter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | SESSION_ID=$( ${COMPUTE_DIR}/session_vcenter.sh ) 7 | 8 | curl -s --insecure -H "Accept: application/json" -H "vmware-api-session-id: ${SESSION_ID}" -X GET https://${VCENTER}/rest/vcenter/datacenter | jq '. | .["value"]' 9 | -------------------------------------------------------------------------------- /compute/list_portgroup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | SESSION_ID=$( ${COMPUTE_DIR}/session_vcenter.sh ) 7 | 8 | curl -s --insecure -H "Accept: application/json" -H "vmware-api-session-id: ${SESSION_ID}" -X GET https://${VCENTER}/rest/vcenter/network | jq '. | .["value"] | .[] | {name: .name, network: .network}' 9 | -------------------------------------------------------------------------------- /compute/list_vapp.ps1: -------------------------------------------------------------------------------- 1 | #Create vApp 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | 10 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple | out-null 11 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass | out-null 12 | 13 | Foreach ( $vAPP in Get-VApp -Location ( Get-Cluster -Name $Cluster ) | Where {$_.name -match "cPod-*"} ) { 14 | Write-Host "$vAPP" 15 | Foreach ( $VM in Get-VM -Location ( Get-VApp -Name $vAPP ) ) { 16 | Write-Host "-- $VM" 17 | } 18 | } 19 | 20 | Disconnect-VIServer -Confirm:$false 21 | -------------------------------------------------------------------------------- /compute/list_vapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | PS_SCRIPT=list_vapp.ps1 7 | 8 | SCRIPT_DIR=/tmp/scripts 9 | SCRIPT=/tmp/scripts/$$.ps1 10 | 11 | mkdir -p ${SCRIPT_DIR} 12 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 13 | 14 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 15 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 16 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 17 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 18 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 19 | ${SCRIPT} 20 | 21 | echo "List vApp." 22 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 23 | 24 | rm -fr ${SCRIPT} 25 | -------------------------------------------------------------------------------- /compute/mac_learning/modify_portgroup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | PS_SCRIPT=modify_portgroup.ps1 9 | 10 | SCRIPT_DIR=/tmp/scripts 11 | SCRIPT=/tmp/scripts/$$.ps1 12 | 13 | mkdir -p ${SCRIPT_DIR} 14 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 15 | 16 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 17 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 18 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 19 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 20 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 21 | -e "s/###PORTGTOUP###/${1}/" \ 22 | ${SCRIPT} 23 | 24 | #echo "Modifying '${1}' with Promiscuous and ForgedTransmits." 25 | echo "Modifying '${1}' with MacLearn and ForgedTransmits." 26 | #docker run --rm -it -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 2>&1 > /dev/null 27 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore ${SCRIPT} 2>&1 > /dev/null 28 | 29 | rm -fr ${SCRIPT} 30 | -------------------------------------------------------------------------------- /compute/modify_portgroup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | PS_SCRIPT=modify_portgroup.ps1 9 | 10 | SCRIPT_DIR=/tmp/scripts 11 | SCRIPT=/tmp/scripts/$$.ps1 12 | 13 | mkdir -p ${SCRIPT_DIR} 14 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 15 | 16 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 17 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 18 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 19 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 20 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 21 | -e "s/###PORTGTOUP###/${1}/" \ 22 | ${SCRIPT} 23 | 24 | #echo "Modifying '${1}' with Promiscuous and ForgedTransmits." 25 | echo "Modifying '${1}' with MacLearn and ForgedTransmits." 26 | #docker run --rm -it -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04powershell ${SCRIPT} 2>&1 > /dev/null 27 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/null 28 | 29 | rm -fr ${SCRIPT} 30 | -------------------------------------------------------------------------------- /compute/promiscuous/modify_portgroup.ps1: -------------------------------------------------------------------------------- 1 | #Mdofity Portgroup 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $Portgroup = "###PORTGTOUP###" 10 | 11 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 12 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 13 | 14 | Get-VDPortgroup $Portgroup | Get-VDSecurityPolicy | Set-VDSecurityPolicy -ForgedTransmits $true -AllowPromiscuous $true 15 | Get-VDPortgroup $Portgroup | Get-VDUplinkTeamingPolicy | Set-VDUplinkTeamingPolicy -ActiveUplinkPort "Uplink 2" -StandbyUplinkPort "Uplink 1" -UnusedUplinkPort "Uplink 3" 16 | Get-VDPortgroup $Portgroup | Get-VDUplinkTeamingPolicy | Set-VDUplinkTeamingPolicy -UnusedUplinkPort "Uplink 4" 17 | -------------------------------------------------------------------------------- /compute/promiscuous/modify_portgroup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | PS_SCRIPT=modify_portgroup.ps1 9 | 10 | SCRIPT_DIR=/tmp/scripts 11 | SCRIPT=/tmp/scripts/$$.ps1 12 | 13 | mkdir -p ${SCRIPT_DIR} 14 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 15 | 16 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 17 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 18 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 19 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 20 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 21 | -e "s/###PORTGTOUP###/${1}/" \ 22 | ${SCRIPT} 23 | 24 | echo "Modifying '${1}' with Promiscuous and ForgedTransmits." 25 | #docker run --rm -it -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 2>&1 > /dev/null 26 | docker run --rm -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 2>&1 > /dev/null 27 | 28 | rm -fr ${SCRIPT} 29 | -------------------------------------------------------------------------------- /compute/put_esx_maintenance_mode.ps1: -------------------------------------------------------------------------------- 1 | #Enter ESX in Maintenance Mode 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $cPodName = "###CPOD_NAME###" 10 | 11 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 12 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 13 | 14 | #Get-VMHost | set-vmhost -State Maintenance 15 | 16 | Foreach ( $VM in Get-VM ) { 17 | if ( $VM -NotMatch "VCSA" ) { 18 | Write-Host "shutdown $VM" 19 | Shutdown-VMGuest -VM $VM -Confirm:$false 20 | } 21 | } 22 | 23 | Foreach ( $ESX in Get-VMHost ) { 24 | Write-Host "$ESX is going to Maintenance Mode" 25 | $vmhost= Get-VMHost $ESX 26 | $spec = new-object VMware.Vim.HostMaintenanceSpec 27 | $spec.VsanMode = new-object VMware.Vim.VsanHostDecommissionMode 28 | $spec.VsanMode.ObjectAction = "ensureObjectAccessibility" 29 | $vmhost.ExtensionData.EnterMaintenanceMode(0, $false, $spec) 30 | } 31 | 32 | Disconnect-VIServer -Confirm:$false 33 | -------------------------------------------------------------------------------- /compute/put_esx_maintenance_mode.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | PS_SCRIPT=put_esx_maintenance_mode.ps1 11 | 12 | SCRIPT_DIR=/tmp/scripts 13 | SCRIPT=/tmp/scripts/$$.ps1 14 | 15 | mkdir -p ${SCRIPT_DIR} 16 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 17 | 18 | NAME_LOWER=$( echo $1 | tr '[:upper:]' '[:lower:]' ) 19 | VCENTER="vcsa.cpod-${NAME_LOWER}.${ROOT_DOMAIN}" 20 | 21 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 22 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 23 | -e "s/###VCENTER_PASSWD###/${VCENTER_CPOD_PASSWD}/" \ 24 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 25 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 26 | -e "s/###CPOD_NAME###/${1}/" \ 27 | ${SCRIPT} 28 | 29 | echo "Enter all ESX in Maintenace Mode for '${1}'." 30 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 31 | 32 | rm -fr ${SCRIPT} 33 | -------------------------------------------------------------------------------- /compute/remove_orphaned.ps1: -------------------------------------------------------------------------------- 1 | $Vc = "###VCENTER###" 2 | $vcUser = "###VCENTER_ADMIN###" 3 | $vcPass = '###VCENTER_PASSWD###' 4 | $Datacenter = "###VCENTER_DATACENTER###" 5 | $Cluster = "###VCENTER_CLUSTER###" 6 | $Domain = "###DOMAIN###" 7 | 8 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 9 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 10 | 11 | foreach ($vm in $allVMs) { 12 | if ($vm.ExtensionData.Runtime.ConnectionState -eq "orphaned") {$vm | Remove-VM -force:$true} 13 | } 14 | -------------------------------------------------------------------------------- /compute/remove_orphaned.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # Usage: remove_orphaned.sh EUC 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | CPOD_NAME=$( echo $1 | tr '[:upper:]' '[:lower:]' ) 11 | CPOD_VCENTER_ADMIN="administrator@vsphere.local" 12 | CPOD_VCENTER_DATACENTER="${1}" 13 | CPOD_VCENTER_CLUSTER="Cluster" 14 | CPOD_DOMAIN="${CPOD_NAME}.${ROOT_DOMAIN}" 15 | CPOD_VCENTER="vcsa.${CPOD_DOMAIN}" 16 | 17 | PS_SCRIPT=remove_orphaned.ps1 18 | 19 | SCRIPT_DIR=/tmp/scripts 20 | SCRIPT=/tmp/scripts/$$.ps1 21 | 22 | mkdir -p ${SCRIPT_DIR} 23 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 24 | 25 | sed -i -e "s/###VCENTER###/${CPOD_VCENTER}/" \ 26 | -e "s/###VCENTER_ADMIN###/${CPOD_VCENTER_ADMIN}/" \ 27 | -e "s/###VCENTER_PASSWD###/${VCENTER_CPOD_PASSWD}/" \ 28 | -e "s/###VCENTER_DATACENTER###/${CPOD_VCENTER_DATACENTER}/" \ 29 | -e "s/###VCENTER_CLUSTER###/${CPOD_VCENTER_CLUSTER}/" \ 30 | -e "s/###DOMAIN###/${CPOD_DOMAIN}/" \ 31 | ${SCRIPT} 32 | 33 | echo "Preparing vCenter of ${1}'." 34 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 35 | 36 | rm -fr ${SCRIPT} 37 | -------------------------------------------------------------------------------- /compute/session_vcenter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | curl -s --insecure -X POST --header "Content-Type: application/json" --header "vmware-use-header-authn: JSON" --header "vmware-api-session-id: null" -u ${VCENTER_ADMIN}:${VCENTER_PASSWD} https://${VCENTER}/rest/com/vmware/cis/session | jq '.value' | sed 's/"//g' 7 | -------------------------------------------------------------------------------- /compute/start_vapp.ps1: -------------------------------------------------------------------------------- 1 | #Create vApp 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $cPodName = "###CPOD_NAME###" 10 | 11 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 12 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 13 | 14 | Write-Host "Starting vApp." 15 | $Vapp = Get-VApp -Name cPod-$cPodName -Location ( Get-Cluster -Name $Cluster ) 16 | Start-VApp -Confirm:$false -VApp $Vapp 17 | 18 | Disconnect-VIServer -Confirm:$false 19 | -------------------------------------------------------------------------------- /compute/start_vapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | PS_SCRIPT=start_vapp.ps1 11 | 12 | SCRIPT_DIR=/tmp/scripts 13 | SCRIPT=/tmp/scripts/$$.ps1 14 | 15 | mkdir -p ${SCRIPT_DIR} 16 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 17 | 18 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 19 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 20 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 21 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 22 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 23 | -e "s/###CPOD_NAME###/${1}/" \ 24 | ${SCRIPT} 25 | 26 | echo "Starting vApp '${HEADER}-${1}'." 27 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/null 28 | 29 | rm -fr ${SCRIPT} 30 | -------------------------------------------------------------------------------- /compute/stop_vapp.ps1: -------------------------------------------------------------------------------- 1 | #Create vApp 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $cPodName = "###CPOD_NAME###" 10 | 11 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 12 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 13 | 14 | Write-Host "Stoping vApp." 15 | $Vapp = Get-VApp -Name cPod-$cPodName -Location ( Get-Cluster -Name $Cluster ) 16 | Stop-VApp -Force -Confirm:$false -VApp $Vapp 17 | 18 | Disconnect-VIServer -Confirm:$false 19 | -------------------------------------------------------------------------------- /compute/stop_vapp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 : cPod Name 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | PS_SCRIPT=stop_vapp.ps1 11 | 12 | SCRIPT_DIR=/tmp/scripts 13 | SCRIPT=/tmp/scripts/$$.ps1 14 | 15 | mkdir -p ${SCRIPT_DIR} 16 | cp ${COMPUTE_DIR}/${PS_SCRIPT} ${SCRIPT} 17 | 18 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 19 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 20 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 21 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 22 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 23 | -e "s/###CPOD_NAME###/${1}/" \ 24 | ${SCRIPT} 25 | 26 | echo "Stoping vApp '${HEADER}-${1}'." 27 | docker run --rm --dns=${DNS} --entrypoint="/usr/bin/pwsh" -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu16.04 ${SCRIPT} 2>&1 > /dev/nul 28 | 29 | rm -fr ${SCRIPT} 30 | -------------------------------------------------------------------------------- /compute/wait_ip.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | STATUS=1 4 | ITERATE=30 5 | 6 | printf "Waiting for ${1} " 7 | while [ ${STATUS} -gt 0 ] && [ ${ITERATE} -gt 0 ] 8 | do 9 | STATUS=$( ping -c 1 ${1} 2>&1 > /dev/null ; echo $? ) 10 | STATUS=$(expr $STATUS) 11 | ITERATE=$( expr ${ITERATE} - 1 ) 12 | printf "." 13 | done 14 | 15 | printf "\n" 16 | 17 | if [ ${ITERATE} -le 0 ]; then 18 | echo "${1} is unreachable" 19 | exit 1 20 | fi 21 | 22 | echo "${1} is reachable" 23 | -------------------------------------------------------------------------------- /cpodctl-completion.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/env bash 2 | #bdereims@vmware.com 3 | 4 | _cpodctl_completions() 5 | { 6 | COMPREPLY+=("list") 7 | COMPREPLY+=("password") 8 | COMPREPLY+=("create") 9 | COMPREPLY+=("delete") 10 | COMPREPLY+=("addfiler") 11 | COMPREPLY+=("vcsa") 12 | COMPREPLY+=("backup") 13 | COMPREPLY+=("restore") 14 | COMPREPLY+=("help") 15 | COMPREPLY+=("lease") 16 | } 17 | 18 | complete -F _cpodctl_completions cpodctl 19 | -------------------------------------------------------------------------------- /enter_maintenance_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | DNSMASQ=/etc/dnsmasq.conf 9 | HOSTS=/etc/hosts 10 | 11 | exit_gate() { 12 | rm -fr lock 13 | exit $1 14 | } 15 | 16 | main() { 17 | mutex 18 | echo "=== Enter all ESX in Maintenance Mode for '${1}'." 19 | 20 | 21 | 22 | exit_gate 0 23 | } 24 | 25 | main $1 $2 26 | -------------------------------------------------------------------------------- /env: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | DNSMASQ=/etc/dnsmasq.conf 5 | HOSTS=/etc/hosts 6 | 7 | WHERE=$( ip addr show eth1 | grep inet | head -1 | awk '{print $2}' ) 8 | ADDRIP=$( ip addr show eth0 | grep inet | head -1 | awk '{print $2}' | sed 's/\/.*$//' ) 9 | export ADDRIP 10 | 11 | case $WHERE in 12 | "172.16.100.50/22") 13 | ALL_CLUSTER=(dell) 14 | ;; 15 | "172.16.100.20/22") 16 | ALL_CLUSTER=(intel) 17 | ;; 18 | esac 19 | 20 | for CLUSTER in ${ALL_CLUSTER[@]}; do 21 | RESULT=$( ./extra/check_datastore.sh ${CLUSTER} ) 22 | if [ "${RESULT}" == "Ok!" ]; then 23 | break 24 | fi 25 | done 26 | 27 | ENV=$CLUSTER 28 | if [[ ! ${CLUSTER} ]]; then 29 | ENV=${ALL_CLUSTER[0]} 30 | fi 31 | 32 | source env-${ENV} 33 | -------------------------------------------------------------------------------- /env-dell: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # this file is not synced in git 5 | . ./env.passwd 6 | 7 | SLACK=YES 8 | LEASE=YES 9 | 10 | export ROOT_DOMAIN="az-lab.shwrfr.com" 11 | 12 | # Transit LS for cPodRouter connectivity 13 | TRANSIT=172.20 14 | ASN=65200 15 | 16 | TRANSIT_NET="172.16" 17 | DNS="${TRANSIT_NET}.2.1" 18 | 19 | CLUSTER="DELL" 20 | HEADER="cPod" 21 | 22 | NETWORK_DIR=network 23 | COMPUTE_DIR=compute 24 | EXTRA_DIR=extra 25 | 26 | NSX=10.1.0.156 27 | NSX_ADMIN="admin" 28 | NSX_TRANSPORTZONE="TransportZone" 29 | 30 | ISO_BANK_SERVER="10.1.0.51" 31 | ISO_BANK_DIR="/VNXeDatastore/ISO-Bank" 32 | 33 | VCENTER=10.1.0.19 34 | VCENTER_ADMIN="cpod@dell.lab" 35 | VCENTER_DATACENTER="DELL-LAB" 36 | VCENTER_CLUSTER="DELL Cluster" 37 | TEMPLATE_VM="template-cPodRouter" 38 | TEMPLATE_ESX="template-ESX67U3" 39 | #TEMPLATE_ESX="template-ESX70beta" 40 | TEMPLATE_FILER="template-cPodFiler" 41 | DATASTORE=${DATASTORE:="DELL-VSAN"} 42 | -------------------------------------------------------------------------------- /env-hp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # this file is not synced in git 5 | . ./env.passwd 6 | 7 | CLUSTER="hp" 8 | HEADER="cPod" 9 | 10 | NETWORK_DIR=network 11 | COMPUTE_DIR=compute 12 | EXTRA_DIR=extra 13 | 14 | NSX=10.1.0.101 15 | NSX_ADMIN="admin" 16 | NSX_TRANSPORTZONE="TransportZone" 17 | EDGE="edge-6" 18 | 19 | ISO_BANK_SERVER="10.1.0.51" 20 | ISO_BANK_DIR="/VNXeDatastore/ISO-Bank" 21 | 22 | VCENTER=10.1.0.100 23 | VCENTER_ADMIN="administrator@vsphere.local" 24 | VCENTER_DATACENTER="Showroom" 25 | VCENTER_CLUSTER="HP Cluster" 26 | TEMPLATE_VM="template-cPodRouter-HP" 27 | TEMPLATE_ESX="template-ESX67U1-HP" 28 | DATASTORE="HP-VSAN" 29 | -------------------------------------------------------------------------------- /env-intel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # this file is not synced in git 5 | . ./env.passwd 6 | 7 | SLACK=NO 8 | LEASE=NO 9 | 10 | ROOT_DOMAIN="az-demo.shwrfr.com" 11 | 12 | # Transit LS for cPodRouter connectivity 13 | TRANSIT=172.19 14 | ASN=65100 15 | 16 | TRANSIT_NET="172.16" 17 | DNS="${TRANSIT_NET}.1.1" 18 | 19 | CLUSTER="INTEL" 20 | HEADER="cPod" 21 | 22 | NETWORK_DIR=network 23 | COMPUTE_DIR=compute 24 | EXTRA_DIR=extra 25 | 26 | NSX=10.1.0.152 27 | NSX_ADMIN="admin" 28 | NSX_TRANSPORTZONE="TransportZone" 29 | 30 | ISO_BANK_SERVER="10.1.0.51" 31 | ISO_BANK_DIR="/VNXeDatastore/ISO-Bank" 32 | 33 | VCENTER=10.1.0.29 34 | VCENTER_ADMIN="cpod@intel.lab" 35 | VCENTER_DATACENTER="INTEL-LAB" 36 | VCENTER_CLUSTER="INTEL Cluster" 37 | TEMPLATE_VM="template-cPodRouter" 38 | TEMPLATE_ESX="template-ESX67U3" 39 | #TEMPLATE_ESX="template-ESX70beta" 40 | TEMPLATE_FILER="template-cPodFiler" 41 | DATASTORE=${DATASTORE:="INTEL-VSAN"} 42 | -------------------------------------------------------------------------------- /env.passwd-template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | NSX_PASSWD=$( echo XXX | base64 -d ) 5 | ROOT_PASSWD=$( echo XXX | base64 -d ) 6 | VCENTER_CPOD_PASSWD=$( echo XXX | base64 -d ) 7 | VCENTER_PASSWD=$( echo XXX | base64 -d ) 8 | -------------------------------------------------------------------------------- /expose_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # Usage : ./expose_cpod.sh TEST (not cPod-TEST) 5 | 6 | . ./env 7 | 8 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 9 | 10 | #======================================================================================== 11 | 12 | DNSMASQ=/etc/dnsmasq.conf 13 | HOSTS=/etc/hosts 14 | 15 | mutex() { 16 | while ! mkdir lock 2>&1 > /dev/null 17 | do 18 | echo "Waiting (PID $$)..." 19 | sleep 2 20 | done 21 | } 22 | 23 | de_mutex() { 24 | rmdir lock 25 | } 26 | 27 | exit_gate() { 28 | #[ -f lock ] && rm lock 29 | exit $1 30 | } 31 | 32 | check_cpod() { 33 | echo "rien" 34 | } 35 | 36 | affect_public_ip() { 37 | PUBLIC_IP=$(grep "$(printf '\t')#FREE#$" public-ip | sort | awk '{print $1}' | head -1) 38 | 39 | if [ "X${PUBLIC_IP}" == "X" ]; then 40 | echo "There is no public IP available." 41 | de_mutex 42 | exit_gate 1 43 | fi 44 | 45 | echo "The Public cPod IP address is '${PUBLIC_IP}'." 46 | } 47 | 48 | expose_cpod() { 49 | echo "rien" 50 | } 51 | 52 | main() { 53 | echo "!!! Work in Progress !!!" 54 | echo " " 55 | CPOD=${1} 56 | check_cpod ${CPOD} 57 | 58 | echo "=== Exposing cPod on Internet." 59 | 60 | mutex 61 | affect_public_ip ${CPOD} 62 | de_mutex 63 | 64 | expose_cpod ${CPOD} ${NEW_TRANSIT_IP} ${PUBLIC_IP} 65 | 66 | exit_gate 0 67 | } 68 | 69 | main ${1} 70 | -------------------------------------------------------------------------------- /extra/check_datastore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./govc_env 5 | 6 | CLUSTER=$( echo ${1} | tr '[:lower:]' '[:upper:]' ) 7 | 8 | DATASTORE=$( govc datastore.info ${CLUSTER}-VSAN | grep Free | sed -e "s/^.*://" -e "s/GB//" -e "s/ //g" ) 9 | DATASTORE=$( echo "${DATASTORE}/1" | bc ) 10 | DATASTORE=$( expr ${DATASTORE} ) 11 | 12 | if [ ${DATASTORE} -lt 10000 ]; then 13 | echo "No more space!" 14 | exit 1 15 | fi 16 | 17 | echo "Ok!" 18 | exit 0 19 | -------------------------------------------------------------------------------- /extra/check_space.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ./govc_env 4 | . ./env 5 | 6 | if [ "${FORCE}" == "1" ]; then 7 | echo "Ok!" 8 | exit 0 9 | fi 10 | 11 | CLUSTER=$( echo $CLUSTER | tr '[:lower:]' '[:upper:]' ) 12 | 13 | VSAN=$( govc datastore.info ${CLUSTER}-VSAN | grep Free | sed -e "s/^.*://" -e "s/GB//" -e "s/ //g" ) 14 | VSAN=$( echo "${VSAN}/1" | bc ) 15 | VSAN=$( expr ${VSAN} ) 16 | 17 | MEM=$( govc metric.sample "host/${CLUSTER} Cluster" mem.usage.average | sed -e "s/,.*$//" | cut -f10 -d" " | cut -f1 -d"." ) 18 | MEM=$( expr ${MEM} ) 19 | 20 | if [ 10000 -gt ${VSAN} ] || [ 80 -lt ${MEM} ] 21 | then 22 | echo "No more space!" 23 | exit 1 24 | fi 25 | 26 | echo "Ok!" 27 | exit 0 28 | -------------------------------------------------------------------------------- /extra/clean_ssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | ps -ef | grep root@pts | awk '{print $2}' | xargs kill 5 | -------------------------------------------------------------------------------- /extra/delete_photonos_cday.ps1: -------------------------------------------------------------------------------- 1 | #Create PhotonOS VM 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $vmName = "###VM_NAME###" 10 | $templateVM = "###TEMPLATE_VM###" 11 | $rootPasswd = "###ROOT_PASSWD###" 12 | $Datastore = "###DATASTORE###" 13 | 14 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 15 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 16 | 17 | ##### 18 | 19 | Stop-VApp -VApp PhotonOS -Confirm:$false 20 | 21 | #$Vapp = Get-VApp -Name 'PhotonOS' 22 | 23 | #$VAppView = $Vapp | Get-View 24 | ForEach ($Entity in Get-VM -Location ( Get-VApp -Name 'PhotonOS' ) ) { 25 | Remove-VM -VM $Entity -DeleteFromDisk -Confirm:$false -RunAsync 26 | } 27 | 28 | #Invoke-VMScript -VM $vmName -ScriptText "date > log ; echo -n > /etc/machine-id ; echo $vmName > /etc/hostname" -GuestUser root -GuestPassword $rootPasswd -scripttype Bash -ToolsWaitSecs 45 29 | 30 | #Restart-VM -VM $vmName -Confirm:$false 31 | 32 | Disconnect-VIServer -Confirm:$false 33 | -------------------------------------------------------------------------------- /extra/delete_photonos_cday_pcli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | export DOMAIN="cpod-cday.shwrfr.mooo.com" 5 | export VCENTER="vcsa.${DOMAIN}" 6 | export VCENTER_ADMIN="administrator@${DOMAIN}" 7 | export VCENTER_PASSWD="VMware1!" 8 | export TEMPLATE_VM=photonos 9 | export ROOT_PASSWD="VMware1!" 10 | export DATASTORE="Datastore" 11 | 12 | PS_SCRIPT=delete_photonos_cday.ps1 13 | 14 | SCRIPT_DIR=/tmp/scripts 15 | SCRIPT=/tmp/scripts/$$.ps1 16 | 17 | mkdir -p ${SCRIPT_DIR} 18 | cp extra/${PS_SCRIPT} ${SCRIPT} 19 | 20 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 21 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 22 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 23 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 24 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 25 | -e "s/###VM_NAME###/${1}/" \ 26 | -e "s/###TEMPLATE_VM###/${TEMPLATE_VM}/" \ 27 | -e "s/###ROOT_PASSWD###/${ROOT_PASSWD}/" \ 28 | -e "s/###DATASTORE###/${DATASTORE}/" \ 29 | ${SCRIPT} 30 | 31 | #docker run --rm -it --dns=10.50.0.3 -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 2>&1 > /dev/null 32 | docker run --rm --dns=10.50.0.3 -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 33 | 34 | rm -fr ${SCRIPT} 35 | -------------------------------------------------------------------------------- /extra/deploy_darkstar.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_DARKSTAR} 25 | NAME=${NAME_DARKSTAR} 26 | OVA=${OVA_DARKSTAR} 27 | 28 | ################### 29 | 30 | export MYSCRIPT=/tmp/$$ 31 | 32 | cat << EOF > ${MYSCRIPT} 33 | cd ${OVFDIR} 34 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 35 | --X:injectOvfEnv --powerOffTarget --allowExtraConfig \ 36 | --X:apiVersion=5.5 --diskMode=thin \ 37 | --prop:password=${PASSWORD} \ 38 | --prop:hostname=${HOSTNAME} \ 39 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 40 | ${OVA} \ 41 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 42 | EOF 43 | 44 | sh ${MYSCRIPT} 45 | 46 | rm ${MYSCRIPT} 47 | -------------------------------------------------------------------------------- /extra/deploy_fortytwo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_FORTYTWO} 25 | NAME=${NAME_FORTYTWO} 26 | OVA=${OVA_FORTYTWO} 27 | 28 | ################### 29 | 30 | #ADMIN="administrator@vsphere.local" 31 | #PORTGROUP="DPortGroup" 32 | 33 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 34 | 35 | export MYSCRIPT=/tmp/$$ 36 | 37 | cat << EOF > ${MYSCRIPT} 38 | cd ${OVFDIR} 39 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 40 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 41 | --X:apiVersion=5.5 --diskMode=thin \ 42 | "--datastore=${DATASTORE}" -n=${NAME} -nw="${PORTGROUP}" \ 43 | ${OVA} \ 44 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 45 | EOF 46 | 47 | sh ${MYSCRIPT} 48 | 49 | rm ${MYSCRIPT} 50 | -------------------------------------------------------------------------------- /extra/deploy_gracehoper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_GRACEHOPER} 25 | NAME=${NAME_GRACEHOPER} 26 | OVA=${OVA_GRACEHOPER} 27 | 28 | ################### 29 | 30 | export MYSCRIPT=/tmp/$$ 31 | 32 | cat << EOF > ${MYSCRIPT} 33 | cd ${OVFDIR} 34 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 35 | --X:injectOvfEnv --powerOffTarget --allowExtraConfig \ 36 | --X:apiVersion=5.5 --diskMode=thin \ 37 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 38 | ${OVA} \ 39 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 40 | EOF 41 | 42 | sh ${MYSCRIPT} 43 | 44 | rm ${MYSCRIPT} 45 | -------------------------------------------------------------------------------- /extra/deploy_hci.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_HCI} 25 | NAME=${NAME_HCI} 26 | OVA=${OVA_HCI} 27 | 28 | ################### 29 | 30 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | cd ${OVFDIR} 36 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 37 | --X:injectOvfEnv --overwrite --allowExtraConfig \ 38 | --X:apiVersion=5.5 --diskMode=thin \ 39 | --prop:Public_Network_Type=DHCP \ 40 | --prop:System_Password="${PASSWORD}" \ 41 | "--datastore=${DATASTORE}" -n=${NAME} \ 42 | --net:"Management Network"="${PORTGROUP}" --net:"VM Network"="${PORTGROUP}" \ 43 | ${OVA} \ 44 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 45 | EOF 46 | 47 | sh ${MYSCRIPT} 48 | 49 | rm ${MYSCRIPT} 50 | -------------------------------------------------------------------------------- /extra/deploy_jumpbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_JUMPBOX} 25 | NAME=${NAME_JUMPBOX} 26 | OVA=${OVA_JUMPBOX} 27 | 28 | ################### 29 | 30 | export MYSCRIPT=/tmp/$$ 31 | 32 | cat << EOF > ${MYSCRIPT} 33 | cd ${OVFDIR} 34 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 35 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 36 | --X:apiVersion=5.5 --diskMode=thin \ 37 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 38 | ${OVA} \ 39 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 40 | EOF 41 | 42 | sh ${MYSCRIPT} 43 | 44 | rm ${MYSCRIPT} 45 | -------------------------------------------------------------------------------- /extra/deploy_nsx-t/README.md: -------------------------------------------------------------------------------- 1 | # nsxt-t_deploy 2 | -------------------------------------------------------------------------------- /extra/deploy_nsx-t/README_3.md: -------------------------------------------------------------------------------- 1 | # Modify your ESXi 2 | 3 | Don't forget to modify the vswitch0 of all ESXi all of Compute Cluster with 1600 as MTU. 4 | -------------------------------------------------------------------------------- /extra/deploy_nsx-t/all-install_activate_configure_nsx.sh: -------------------------------------------------------------------------------- 1 | source ./install_nsx.env 2 | ./1-install_nsx.sh 3 | sleep 180 4 | ./2-activate_nsx_cluster.sh 5 | 6 | source ./configure_nsx.env 7 | ./3-configure_nsx.sh 8 | -------------------------------------------------------------------------------- /extra/deploy_nsx-t/configure_nsx.env: -------------------------------------------------------------------------------- 1 | export NETWORK_TUNNEL_IP_POOL_CIDR="172.18.21.0/24" 2 | export NETWORK_TUNNEL_IP_POOL_ALLOCATION_START="172.18.21.180" 3 | export NETWORK_TUNNEL_IP_POOL_ALLOCATION_END="172.18.21.199" 4 | export NETWORK_T0_SUBNET_IP_ADDRESS="172.18.21.8" 5 | export NETWORK_T0_SUBNET_PREFIX_LENGTH=24 6 | export NETWORK_T0_GATEWAY="172.18.21.1" 7 | export NETWORK_HOST_UPLINK_PNIC='vmnic1' 8 | -------------------------------------------------------------------------------- /extra/deploy_nsx-t/delete_nsx.env: -------------------------------------------------------------------------------- 1 | ESXI_1=10.115.40.87 2 | ESXI_2=10.115.40.72 3 | ESXI_USERNAME=root 4 | ESXI_PASSWORD='VMware1!' 5 | 6 | -------------------------------------------------------------------------------- /extra/deploy_nsx-v.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_NSX} 25 | NAME=${NAME_NSX} 26 | IP=${IP_NSX} 27 | OVA=${OVA_NSX} 28 | 29 | ################### 30 | 31 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 32 | 33 | export MYSCRIPT=/tmp/$$ 34 | 35 | cat << EOF > ${MYSCRIPT} 36 | ovftool --acceptAllEulas --skipManifestCheck --X:injectOvfEnv --allowExtraConfig \ 37 | --prop:vsm_cli_passwd_0=${PASSWORD} \ 38 | --prop:vsm_cli_en_passwd_0=${PASSWORD} \ 39 | --prop:vsm_hostname=${HOSTNAME} \ 40 | --prop:vsm_ip_0=${IP} \ 41 | --prop:vsm_netmask_0=${NETMASK} \ 42 | --prop:vsm_gateway_0=${GATEWAY} \ 43 | --prop:vsm_dns1_0=${DNS} \ 44 | --prop:vsm_domain_0=${DOMAIN} \ 45 | --prop:vsm_ntp_0=${NTP} \ 46 | --prop:vsm_isSSHEnabled=True \ 47 | -ds=${DATASTORE} -n=${NAME} --network='${PORTGROUP}' \ 48 | ${OVA} \ 49 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 50 | EOF 51 | 52 | sh ${MYSCRIPT} 53 | 54 | rm ${MYSCRIPT} 55 | -------------------------------------------------------------------------------- /extra/deploy_opsmanager-2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_OPSMANAGER} 25 | NAME=${NAME_OPSMANAGER} 26 | IP=${IP_OPSMANAGER} 27 | OVA=${OVA_OPSMANAGER} 28 | export TARGET=vcsa.${DOMAIN}/cPod-${CPOD}/host/Compute 29 | 30 | ################### 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | ovftool --acceptAllEulas --skipManifestCheck --X:injectOvfEnv --allowExtraConfig \ 36 | --prop:admin_password=${PASSWORD} \ 37 | --prop:custom_hostname=${HOSTNAME} \ 38 | --prop:ip0=192.168.29.2 \ 39 | --prop:netmask0=${NETMASK} \ 40 | --prop:gateway=192.168.29.1 \ 41 | --prop:DNS=${DNS} \ 42 | --prop:ntp_servers=${NTP} \ 43 | -ds=${DATASTORE} -n=${NAME} --network='${PORTGROUP}' \ 44 | ${OVA} \ 45 | vi://${ADMIN}:'${VC_PASSWORD}'@${TARGET} 46 | EOF 47 | 48 | sh ${MYSCRIPT} 49 | 50 | #rm ${MYSCRIPT} 51 | -------------------------------------------------------------------------------- /extra/deploy_opsmanager.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_OPSMANAGER} 25 | NAME=${NAME_OPSMANAGER} 26 | IP=${IP_OPSMANAGER} 27 | OVA=${OVA_OPSMANAGER} 28 | 29 | ################### 30 | 31 | export MYSCRIPT=/tmp/$$ 32 | 33 | cat << EOF > ${MYSCRIPT} 34 | ovftool --acceptAllEulas --skipManifestCheck --X:injectOvfEnv --allowExtraConfig \ 35 | --prop:admin_password=${PASSWORD} \ 36 | --prop:custom_hostname=${HOSTNAME} \ 37 | --prop:ip0=${IP} \ 38 | --prop:netmask0=${NETMASK} \ 39 | --prop:gateway=${GATEWAY} \ 40 | --prop:DNS=${DNS} \ 41 | --prop:ntp_servers=${NTP} \ 42 | -ds=${DATASTORE} -n=${NAME} --network='${PORTGROUP}' \ 43 | ${OVA} \ 44 | vi://${ADMIN}:'${VC_PASSWORD}'@${TARGET} 45 | EOF 46 | 47 | sh ${MYSCRIPT} 48 | 49 | #rm ${MYSCRIPT} 50 | -------------------------------------------------------------------------------- /extra/deploy_photonos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_PHOTONOS} 25 | NAME=${NAME_PHOTONOS} 26 | OVA=${OVA_PHOTONOS} 27 | #TARGET=vcsa.${DOMAIN}/cPod-${CPOD}/host/COMPUTE 28 | #PORTGROUP="DPortGroup" 29 | 30 | ################### 31 | 32 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 33 | 34 | export MYSCRIPT=/tmp/$$ 35 | 36 | cat << EOF > ${MYSCRIPT} 37 | cd ${OVFDIR} 38 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 39 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 40 | --X:apiVersion=5.5 --diskMode=thin \ 41 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 42 | ${OVA} \ 43 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 44 | EOF 45 | 46 | sh ${MYSCRIPT} 47 | 48 | rm ${MYSCRIPT} 49 | -------------------------------------------------------------------------------- /extra/deploy_photonos_cday.ps1: -------------------------------------------------------------------------------- 1 | #Create PhotonOS VM 2 | #bdereims@vmware.com 3 | 4 | $Vc = "###VCENTER###" 5 | $vcUser = "###VCENTER_ADMIN###" 6 | $vcPass = '###VCENTER_PASSWD###' 7 | $Datacenter = "###VCENTER_DATACENTER###" 8 | $Cluster = "###VCENTER_CLUSTER###" 9 | $vmName = "###VM_NAME###" 10 | $templateVM = "###TEMPLATE_VM###" 11 | $rootPasswd = "###ROOT_PASSWD###" 12 | $Datastore = "###DATASTORE###" 13 | 14 | Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -DefaultVIServerMode multiple 15 | Connect-VIServer -Server $Vc -User $vcUser -Password $vcPass 16 | 17 | ##### 18 | 19 | $Vapp = Get-VApp -Name 'PhotonOS' 20 | 21 | $VAppView = $Vapp | Get-View 22 | ForEach ($Entity in $VAppView.VAppConfig.EntityConfig) { 23 | $VAppConfigSpec = New-Object VMware.Vim.VAppConfigSpec 24 | $EntityConfig = New-Object VMware.Vim.VAppEntityConfigInfo 25 | $EntityConfig.Key = (Get-View $Entity.Key).MoRef 26 | $EntityConfig.StopAction = "guestShutdown" 27 | $EntityConfig.StartOrder = 1 28 | $EntityConfig.StartDelay = 1 29 | $VAppConfigSpec.EntityConfig = $EntityConfig 30 | 31 | $VAppView.UpdateVAppConfig($VAppConfigSpec) 32 | } 33 | 34 | Start-VApp -VApp PhotonOS 35 | 36 | sleep 45 37 | 38 | ForEach ($Entity in Get-VM -Location $Vapp ) { 39 | Invoke-VMScript -VM $Entity -ScriptText "date > log ; echo -n > /etc/machine-id ; echo $Entity > /etc/hostname" -GuestUser root -GuestPassword $rootPasswd -scripttype Bash -ToolsWaitSecs 45 40 | } 41 | 42 | sleep 30 43 | 44 | Stop-VApp -VApp $Vapp -Force -Confirm:$false 45 | 46 | sleep 15 47 | 48 | Start-VApp -VApp $Vapp 49 | 50 | sleep 15 51 | 52 | Disconnect-VIServer -Confirm:$false 53 | -------------------------------------------------------------------------------- /extra/deploy_photonos_cday.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 from 5 | # $2 to 6 | 7 | . ./env 8 | CPOD="CDAY" 9 | . ./${COMPUTE_DIR}/cpod-xxx_env 10 | 11 | 12 | ### Local vars #### 13 | 14 | OVA=${OVA_PHOTONOS} 15 | TARGET=vcsa.${DOMAIN}/cPod-${CPOD}/host/Cluster 16 | 17 | ################### 18 | 19 | deploy_photonos() { 20 | echo "Deploying ${NAME}..." 21 | 22 | export MYSCRIPT=/tmp/$$-${1} 23 | 24 | cat << EOF > ${MYSCRIPT} 25 | cd ${OVFDIR} 26 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 27 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 28 | --X:apiVersion=5.5 --diskMode=thin --powerOn \ 29 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 30 | ${OVA} \ 31 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 32 | EOF 33 | 34 | nohup sh ${MYSCRIPT} >/dev/null 2>&1 & 35 | } 36 | 37 | for i in `seq ${1} ${2}`; 38 | do 39 | NUM=$( printf %02d ${i} ) 40 | HOSTNAME="${HOSTNAME_PHOTONOS}-${NUM}" 41 | NAME="${NAME_PHOTONOS}-${NUM}" 42 | 43 | deploy_photonos ${NUM} 44 | done 45 | 46 | exit 0 47 | 48 | export MYSCRIPT=/tmp/$$ 49 | 50 | cat << EOF > ${MYSCRIPT} 51 | cd ${OVFDIR} 52 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 53 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 54 | --X:apiVersion=5.5 --diskMode=thin \ 55 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 56 | ${OVA} \ 57 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 58 | EOF 59 | 60 | sh ${MYSCRIPT} 61 | 62 | rm ${MYSCRIPT} 63 | -------------------------------------------------------------------------------- /extra/deploy_photonos_cday_mail.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # $1 from 5 | # $2 to 6 | 7 | . ./env 8 | CPOD="CDAY" 9 | . ./${COMPUTE_DIR}/cpod-xxx_env 10 | 11 | 12 | ### Local vars #### 13 | 14 | #OVA=${OVA_PHOTONOS} 15 | OVA=${BITS}/photonos-cday.ova 16 | TARGET=vcsa.${DOMAIN}/cPod-${CPOD}/vm/PhotonOS 17 | 18 | ################### 19 | 20 | deploy_photonos() { 21 | echo "Deploying ${1}..." 22 | 23 | export MYSCRIPT=/tmp/$$-${1} 24 | 25 | cat << EOF > ${MYSCRIPT} 26 | cd ${OVFDIR} 27 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 28 | --X:injectOvfEnv --overwrite --allowExtraConfig \ 29 | --X:apiVersion=5.5 --diskMode=thin \ 30 | "--datastore=${DATASTORE}" -n=${NAME} "--network=${PORTGROUP}" \ 31 | ${OVA} \ 32 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 33 | EOF 34 | 35 | nohup sh ${MYSCRIPT} >/dev/null 2>&1 & 36 | } 37 | 38 | for i in `cd ~ ; ./list_mail_users.sh`; 39 | do 40 | NAME="${i}" 41 | 42 | deploy_photonos ${NAME} 43 | done 44 | 45 | exit 0 46 | -------------------------------------------------------------------------------- /extra/deploy_photonos_cday_pcli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | export DOMAIN="cpod-cday.shwrfr.mooo.com" 5 | export VCENTER="vcsa.${DOMAIN}" 6 | export VCENTER_ADMIN="administrator@${DOMAIN}" 7 | export VCENTER_PASSWD="VMware1!" 8 | export TEMPLATE_VM=photonos 9 | export ROOT_PASSWD="VMware1!" 10 | export DATASTORE="Datastore" 11 | 12 | PS_SCRIPT=deploy_photonos_cday.ps1 13 | 14 | SCRIPT_DIR=/tmp/scripts 15 | SCRIPT=/tmp/scripts/$$.ps1 16 | 17 | mkdir -p ${SCRIPT_DIR} 18 | cp extra/${PS_SCRIPT} ${SCRIPT} 19 | 20 | sed -i -e "s/###VCENTER###/${VCENTER}/" \ 21 | -e "s/###VCENTER_ADMIN###/${VCENTER_ADMIN}/" \ 22 | -e "s/###VCENTER_PASSWD###/${VCENTER_PASSWD}/" \ 23 | -e "s/###VCENTER_DATACENTER###/${VCENTER_DATACENTER}/" \ 24 | -e "s/###VCENTER_CLUSTER###/${VCENTER_CLUSTER}/" \ 25 | -e "s/###VM_NAME###/${1}/" \ 26 | -e "s/###TEMPLATE_VM###/${TEMPLATE_VM}/" \ 27 | -e "s/###ROOT_PASSWD###/${ROOT_PASSWD}/" \ 28 | -e "s/###DATASTORE###/${DATASTORE}/" \ 29 | ${SCRIPT} 30 | 31 | #docker run --rm -it --dns=10.50.0.3 -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 2>&1 > /dev/null 32 | docker run --rm --dns=10.50.0.3 -v ${SCRIPT_DIR}:${SCRIPT_DIR} vmware/powerclicore:ubuntu14.04 powershell ${SCRIPT} 33 | 34 | rm -fr ${SCRIPT} 35 | -------------------------------------------------------------------------------- /extra/deploy_photonos_cday_users.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | CPOD="CDAY" 6 | . ./${COMPUTE_DIR}/cpod-xxx_env 7 | 8 | 9 | ### Local vars #### 10 | 11 | OVA=${OVA_PHOTONOS} 12 | TARGET=vcsa.${DOMAIN}/cPod-${CPOD}/host/Cluster 13 | 14 | ################### 15 | 16 | deploy_photonos() { 17 | echo "Deploying ${1}..." 18 | 19 | export MYSCRIPT=/tmp/$$-${1} 20 | 21 | cat << EOF > ${MYSCRIPT} 22 | cd ${OVFDIR} 23 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 24 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 25 | --X:apiVersion=5.5 --diskMode=thin --powerOn \ 26 | "--datastore=${DATASTORE}" -n=${1} "--network=${PORTGROUP}" \ 27 | ${OVA} \ 28 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 29 | EOF 30 | 31 | nohup sh ${MYSCRIPT} >/dev/null 2>&1 & 32 | } 33 | 34 | deploy_photonos_pcli() { 35 | echo "deploying ${1}..." 36 | ./extra/deploy_photonos_cday_pcli.sh ${1} 37 | } 38 | 39 | for i in `cd ~ ; ./list_mail_users.sh | sed -e 's/@.*$//'`; 40 | do 41 | NAME="${i}" 42 | #deploy_photonos ${NAME} 43 | deploy_photonos_pcli ${NAME} 44 | done 45 | 46 | exit 0 47 | -------------------------------------------------------------------------------- /extra/deploy_rift.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_RIFT} 25 | NAME=${NAME_RIFT} 26 | OVA=${OVA_RIFT} 27 | 28 | ################### 29 | 30 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | cd ${OVFDIR} 36 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 37 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 38 | --X:apiVersion=5.5 --diskMode=thin \ 39 | "--datastore=${DATASTORE}" -n=${NAME} -nw="${PORTGROUP}" \ 40 | ${OVA} \ 41 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 42 | EOF 43 | 44 | sh ${MYSCRIPT} 45 | 46 | rm ${MYSCRIPT} 47 | -------------------------------------------------------------------------------- /extra/deploy_ubuntu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_UBUNTU} 25 | NAME=${NAME_UBUNTU} 26 | OVA=${OVA_UBUNTU} 27 | 28 | ################### 29 | 30 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | cd ${OVFDIR} 36 | ovftool --acceptAllEulas --noSSLVerify --skipManifestCheck \ 37 | --X:injectOvfEnv --overwrite --powerOffTarget --allowExtraConfig \ 38 | --X:apiVersion=5.5 --diskMode=thin \ 39 | "--datastore=${DATASTORE}" -n=${NAME} -nw="${PORTGROUP}" \ 40 | ${OVA} \ 41 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 42 | EOF 43 | 44 | sh ${MYSCRIPT} 45 | 46 | rm ${MYSCRIPT} 47 | -------------------------------------------------------------------------------- /extra/deploy_vio-k8s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 5 | 6 | . ./env 7 | 8 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 9 | 10 | if [ -f "${1}" ]; then 11 | . ./${COMPUTE_DIR}/"${1}" 12 | else 13 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 14 | 15 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 16 | 17 | CPOD=${1} 18 | . ./${COMPUTE_DIR}/cpod-xxx_env 19 | fi 20 | 21 | ### Local vars #### 22 | 23 | HOSTNAME=${HOSTNAME_VIO_K8S} 24 | NAME=${NAME_VIO_K8S} 25 | IP=${IP_VIO_K8S} 26 | OVA=${OVA_VIO_K8S} 27 | VC_PASSWORD=$( ./extra/passwd_for_cpod.sh ${1} ) 28 | PASSWORD=${VC_PASSWORD} 29 | 30 | ################### 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | ovftool --acceptAllEulas --allowExtraConfig \ 36 | --prop:vami.domain.management-server=${DOMAIN} \ 37 | --prop:vami.ip0.management-server=${IP} \ 38 | --prop:vami.netmask0.management-server=${NETMASK} \ 39 | --prop:vami.gateway.management-server=${GATEWAY} \ 40 | --prop:vami.DNS.management-server=${DNS} \ 41 | --prop:vami.searchpath.management-server=${DOMAIN} \ 42 | "--prop:root_pwd=${PASSWD}" \ 43 | --vService:"installation"="com.vmware.vim.vsm:extension_vservice" \ 44 | -ds=${DATASTORE} -n=${NAME} --network='${PORTGROUP}' \ 45 | ${OVA} \ 46 | vi://${ADMIN}:'${VC_PASSWORD}'@${TARGET} 47 | EOF 48 | 49 | sh ${MYSCRIPT} 50 | 51 | rm ${MYSCRIPT} 52 | -------------------------------------------------------------------------------- /extra/deploy_vio.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 5 | 6 | . ./env 7 | 8 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 9 | 10 | if [ -f "${1}" ]; then 11 | . ./${COMPUTE_DIR}/"${1}" 12 | else 13 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 14 | 15 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 16 | 17 | CPOD=${1} 18 | . ./${COMPUTE_DIR}/cpod-xxx_env 19 | fi 20 | 21 | ### Local vars #### 22 | 23 | HOSTNAME=${HOSTNAME_VIO} 24 | NAME=${NAME_VIO} 25 | IP=${IP_VIO} 26 | OVA=${OVA_VIO} 27 | VC_PASSWORD=$( ./extra/passwd_for_cpod.sh ${1} ) 28 | PASSWORD=${VC_PASSWORD} 29 | 30 | ################### 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | ovftool --acceptAllEulas --allowExtraConfig \ 36 | --prop:vami.domain.management-server=${DOMAIN} \ 37 | --prop:vami.ip0.management-server=${IP} \ 38 | --prop:vami.netmask0.management-server=${NETMASK} \ 39 | --prop:vami.gateway.management-server=${GATEWAY} \ 40 | --prop:vami.DNS.management-server=${DNS} \ 41 | --prop:vami.searchpath.management-server=${DOMAIN} \ 42 | --prop:ntpServer=${NTP} \ 43 | --prop:syslogServer=vrli.${DOMAIN} \ 44 | --prop:syslogProtocol=UDP \ 45 | --prop:syslogPort=514 \ 46 | "--prop:viouser_passwd=${PASSWD}" \ 47 | --vService:"installation"="com.vmware.vim.vsm:extension_vservice" \ 48 | -ds=${DATASTORE} -n=${NAME} --network='${PORTGROUP}' \ 49 | ${OVA} \ 50 | vi://${ADMIN}:'${VC_PASSWORD}'@${TARGET} 51 | EOF 52 | 53 | sh ${MYSCRIPT} 54 | 55 | rm ${MYSCRIPT} 56 | -------------------------------------------------------------------------------- /extra/deploy_vrli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 6 | 7 | . ./env 8 | 9 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 10 | 11 | if [ -f "${1}" ]; then 12 | . ./${COMPUTE_DIR}/"${1}" 13 | else 14 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 15 | 16 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 17 | 18 | CPOD=${1} 19 | . ./${COMPUTE_DIR}/cpod-xxx_env 20 | fi 21 | 22 | ### Local vars #### 23 | 24 | HOSTNAME=${HOSTNAME_VRLI} 25 | NAME=${NAME_VRLI} 26 | IP=${IP_VRLI} 27 | OVA=${OVA_VRLI} 28 | 29 | ################### 30 | 31 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 32 | 33 | export MYSCRIPT=/tmp/$$ 34 | 35 | cat << EOF > ${MYSCRIPT} 36 | ovftool --acceptAllEulas --X:injectOvfEnv --allowExtraConfig \ 37 | --prop:vami.DNS.VMware_vCenter_Log_Insight=${DNS} \ 38 | --prop:vami.domain.VMware_vCenter_Log_Insight=${DOMAIN} \ 39 | --prop:vami.gateway.VMware_vCenter_Log_Insight=${GATEWAY} \ 40 | --prop:vami.hostname.VMware_vCenter_Log_Insight=${HOSTNAME} \ 41 | --prop:vami.ip0.VMware_vCenter_Log_Insight=${IP} \ 42 | --prop:vami.netmask0.VMware_vCenter_Log_Insight=${NETMASK} \ 43 | --prop:vami.searchpath.VMware_vCenter_Log_Insight=${DOMAIN} \ 44 | --prop:vm.rootpw=${PASSWORD} \ 45 | -ds=${DATASTORE} -n=${NAME} "--network=${PORTGROUP}" \ 46 | ${OVA} \ 47 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 48 | EOF 49 | 50 | sh ${MYSCRIPT} 51 | 52 | rm ${MYSCRIPT} 53 | -------------------------------------------------------------------------------- /extra/deploy_vrops.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | [ "${1}" == "" ] && echo "usage: ${0} deploy_env" && exit 1 5 | 6 | . ./env 7 | 8 | [ "${1}" == "" ] && echo "usage: ${0} " && exit 1 9 | 10 | if [ -f "${1}" ]; then 11 | . ./${COMPUTE_DIR}/"${1}" 12 | else 13 | SUBNET=$( ./${COMPUTE_DIR}/cpod_ip.sh ${1} ) 14 | 15 | [ $? -ne 0 ] && echo "error: file or env '${1}' does not exist" && exit 1 16 | 17 | CPOD=${1} 18 | . ./${COMPUTE_DIR}/cpod-xxx_env 19 | fi 20 | 21 | ### Local vars #### 22 | 23 | HOSTNAME=${HOSTNAME_VROPS} 24 | NAME=${NAME_VROPS} 25 | IP=${IP_VROPS} 26 | OVA=${OVA_VROPS} 27 | 28 | ################### 29 | 30 | PASSWORD=$( ./${EXTRA_DIR}/passwd_for_cpod.sh ${1} ) 31 | 32 | export MYSCRIPT=/tmp/$$ 33 | 34 | cat << EOF > ${MYSCRIPT} 35 | ovftool --acceptAllEulas --X:injectOvfEnv --allowExtraConfig \ 36 | "--prop:vamitimezone=Europe/Paris" \ 37 | --prop:vami.DNS.vRealize_Operations_Manager_Appliance=${DNS} \ 38 | --prop:vami.gateway.vRealize_Operations_Manager_Appliance=${GATEWAY} \ 39 | --prop:vami.ip0.vRealize_Operations_Manager_Appliance=${IP} \ 40 | --prop:vami.netmask0.vRealize_Operations_Manager_Appliance=${NETMASK} \ 41 | -ds=${DATASTORE} -n=${NAME} "--network=${PORTGROUP}" \ 42 | ${OVA} \ 43 | vi://${ADMIN}:'${PASSWORD}'@${TARGET} 44 | EOF 45 | 46 | sh ${MYSCRIPT} 47 | 48 | rm ${MYSCRIPT} 49 | -------------------------------------------------------------------------------- /extra/gen_passwd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | #bdereims@vmware.com 3 | 4 | echo "$(pwgen -s -1 15 1)!" 5 | -------------------------------------------------------------------------------- /extra/leases/leases.txt: -------------------------------------------------------------------------------- 1 | 276 cpod-MMH-CLOUD adeleporte stop 17/01/20 2 | 280 cpod-MMH-LEGACY adeleporte stop 17/01/20 3 | 286 cpod-MLE-K8S lelouchm stop 17/01/20 4 | 288 cpod-FBE fbenrejdal stop 20/01/20 5 | 290 cpod-PCF fbenrejdal stop 20/01/20 6 | 292 cpod-MAYA mkurdi stop 20/01/20 7 | 294 cpod-MLE-TEST lelouchm stop 20/01/20 8 | 305 cpod-*BHAP* bhappe stop 21/01/20 9 | 306 cpod-GROUPAMA adeleporte stop 21/01/20 10 | 311 cpod-OCP hedimo stop 21/01/20 11 | 312 cpod-BHAPPE bhappe stop 21/01/20 12 | -------------------------------------------------------------------------------- /extra/migrate-vm.ps1: -------------------------------------------------------------------------------- 1 | $sourceVC = 'sourcevc' 2 | $sourceVCUsername = 'administrator@vsphere.local' 3 | $sourceVCPassword= 'password!' 4 | 5 | $destVC = 'destinationvc' 6 | $destVCUsername = 'administrator@vsphere.local' 7 | $destVCPassword= 'password' 8 | $destESXi = 'destinationesxi' 9 | 10 | $vmname = 'vmname' 11 | $Switchname = 'destinationswitch' 12 | $NetworkName = 'destinationvlan' 13 | $datastorename = 'destinationdatastore' 14 | 15 | # Connect to the vCenter Servers 16 | $sourceVCConn = Connect-VIServer -Server $sourceVC -user $sourceVCUsername -password $sourceVCPassword 17 | $destVCConn = Connect-VIServer -Server $destVC -user $destVCUsername -password $destVCPassword 18 | $vm = Get-VM $vmname -Server $sourceVCConn 19 | $networkAdapter = Get-NetworkAdapter -VM $vm -Server $sourceVCConn 20 | 21 | $destination = Get-VMHost -name $destESXi -Server $destVCConn 22 | $destinationPortGroup = Get-VirtualPortGroup -VirtualSwitch $Switchname -name $NetworkName -VMHost $destination 23 | $destinationDatastore = Get-Datastore -name $datastorename -Server $destVCConn 24 | Move-VM -VM $vm -Destination $destination -NetworkAdapter $networkAdapter -PortGroup $destinationPortGroup -Datastore $destinationDatastore 25 | -------------------------------------------------------------------------------- /extra/passgen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pwgen -s -N 1 -n -c -y 10 | sed -e 's/\\/!/' -e 's/;/-/' -e 's/"/$/' 4 | -------------------------------------------------------------------------------- /extra/passwd_for_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 )>" && exit 1 7 | 8 | HOSTS=/etc/hosts 9 | CPOD=$( echo $1 | tr '[:upper:]' '[:lower:]' ) 10 | 11 | main() { 12 | cat /etc/hosts | sed -n "/cpod-${CPOD}\t/p" | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print $4}' 13 | } 14 | 15 | main $1 16 | -------------------------------------------------------------------------------- /extra/post_slack.sh-template: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} text_of_the_message" && exit 1 6 | 7 | CONTENT_FILE=/tmp/$$ 8 | echo "{\"text\":\"${1}\"}" > ${CONTENT_FILE} 9 | 10 | curl -X POST -H 'Content-type: application/json' --data @${CONTENT_FILE} https://hooks.slack.com/services/... 11 | 12 | rm ${CONTENT_FILE} 13 | -------------------------------------------------------------------------------- /extra/pwgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/extra/pwgen -------------------------------------------------------------------------------- /extra/receive_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | #bdereims@vmware.com 3 | 4 | PORT=7000 5 | 6 | netcat -l -p ${PORT} | pv | tar x 7 | -------------------------------------------------------------------------------- /extra/send_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | #bdereims@vmware.com 3 | 4 | # $1 : which file 5 | # $2 : to which box, i.e. the receiver 6 | 7 | PORT=7000 8 | 9 | tar cf - ${1} | pv | netcat ${2} ${PORT} 10 | -------------------------------------------------------------------------------- /extra/update_cpodegde.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | #bdereims@vmware.com 3 | 4 | backup_file() { 5 | cp ${1} ${1}-bkp 6 | } 7 | 8 | # Backup files 9 | backup_file /etc/dnsmasq.conf 10 | backup_file /etc/nginx/html/index.html 11 | 12 | # Upgrade 13 | tdnf -y update 14 | 15 | # Delete tricky file 16 | rm /etc/systemd/network/99-dhcp-en.network 17 | -------------------------------------------------------------------------------- /govc_env-example: -------------------------------------------------------------------------------- 1 | export GOVC_USERNAME=administrator@vsphere.local 2 | export GOVC_PASSWORD= 3 | #export GOVC_URL="https://${GOVC_USERNAME}:${GOVC_PASSWORD}@vcsa.cpod-gv.shwrfr.com/sdk" 4 | export GOVC_URL=10.1.0.100 5 | export GOVC_INSECURE=1 6 | export GOVC_DATACENTER=Showroom 7 | export GOVC_DATASTORE=DELL-VSAN 8 | export GOVC_HOST=10.1.0.100 9 | export GOVC_NETWORK="VM Network" 10 | export GOVC_RESOURCE_POOL='/Showroom/host/DELL Cluster/Resources' 11 | -------------------------------------------------------------------------------- /info_shwrfr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | . ./govc_env 6 | 7 | main() { 8 | INFO=$( govc datastore.info ) 9 | echo $INFO 10 | #./extra/post_slack.sh "Deleting cPod *${NAME_HIGH}*" 11 | } 12 | 13 | main $1 14 | -------------------------------------------------------------------------------- /install/1-update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | chage -I -1 -m 0 -M 99999 -E -1 root 5 | useradd -U quagga 6 | 7 | tdnf -y install awk jq dnsmasq make ntp tmux sshpass iperf socat libpcap 8 | 9 | systemctl enable docker 10 | systemctl start docker 11 | 12 | systemctl enable ntpd 13 | systemctl start ntpd 14 | 15 | systemctl enable bgpd 16 | systemctl start bgpd 17 | -------------------------------------------------------------------------------- /install/acme.sh/account.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | LOG_FILE='/root/.acme.sh/acme.sh.log' 4 | #LOG_LEVEL=1 5 | 6 | #AUTO_UPGRADE="1" 7 | 8 | #NO_TIMESTAMP=1 9 | 10 | 11 | USER_PATH='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/root/ovftool' 12 | -------------------------------------------------------------------------------- /install/acme.sh/acme.sh.env: -------------------------------------------------------------------------------- 1 | export LE_WORKING_DIR="/root/.acme.sh" 2 | alias acme.sh="/root/.acme.sh/acme.sh" 3 | -------------------------------------------------------------------------------- /install/acme.sh/ca/acme-staging.api.letsencrypt.org/account.json: -------------------------------------------------------------------------------- 1 | {"id": 5289479,"key":{"kty":"RSA","n":"oB4fGXvHbUKevhm9Icn5s9Cyf4Gy-1OzUhRGaiH6pDPphYrj8Pz3VN2sUOTjQoWawEREUSWJJCcQLAbaCSEl2dI_KA7H8CClJHVS96vwo2IJHeoZAWVrz71VUU1K5RWZLPvfDTYhdz4Jdfnx1dy6tVdkH9PlcnjQMzA3wViNW9MRGRRZk7Alx-Yv01PYAVEkpcxVNi6vUkMAfObZ4Zbux99AkKOrxOYkEthF0-HLtbAKqmPolKZNfHrVeXYpUREjl36-oVY5aC5rt0t9ypmmALdpWvZTABkra3jNOjROW8dU881Roxpp3MppjU3lfDROfJGRmweCwzXXPlxfGU6qpw","e":"AQAB"},"contact":[],"agreement":"https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf","initialIp":"37.71.87.221","createdAt":"2017-12-26T17:19:37.661820116Z","Status":"valid"} 2 | -------------------------------------------------------------------------------- /install/acme.sh/ca/acme-staging.api.letsencrypt.org/ca.conf: -------------------------------------------------------------------------------- 1 | ACCOUNT_URL='https://acme-staging.api.letsencrypt.org/acme/reg/5289479' 2 | CA_KEY_HASH='/SUoNVshHlwbVe0Pk39imlP0Vv5rfSJ3RIEdYiq/uZ4=' 3 | -------------------------------------------------------------------------------- /install/acme.sh/ca/acme-v01.api.letsencrypt.org/account.json: -------------------------------------------------------------------------------- 1 | {"id": 26515593,"key":{"kty":"RSA","n":"9HP5bLVtbiM6aCUy3fIrn_Uw9m1Z9y5x2UpuIBtZHwpBAH0cTwflRuuQzlYQyY_nCsEvHDuMYGNtKFZJY6ERLyWUN_aSn2wig2uapThCFVIhMuRZlWIub0Xg-V4hDY4tbe4yHUmygK8QUO_c9f9opzcHjXLYNTavWemqoyEwKkY9p2cI2Ub-9BpBvm6UO0SfohqGQY3jZi1weaxfNPgaHHbCiU4Fl9wsHtLP70jm6xRT-uHZCTaXpwMdvw09avOEwZKvvQkAKonVeegD-8mjiyP2lw8Be3NcCOQgpGE9wb9ZvzB5rurHs_WZKJxqV31MmcVX7aMGpDSWVS5u1MTAQQ","e":"AQAB"},"contact":[],"agreement":"https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf","initialIp":"37.71.87.221","createdAt":"2017-12-26T16:45:58.632891265Z","Status":"valid"} 2 | -------------------------------------------------------------------------------- /install/acme.sh/ca/acme-v01.api.letsencrypt.org/ca.conf: -------------------------------------------------------------------------------- 1 | ACCOUNT_URL='https://acme-v01.api.letsencrypt.org/acme/reg/26515593' 2 | CA_KEY_HASH='MJvX+iO+kDQSP8Cp2uJKlCtlfGAOHOwKgK+yhX18Mf0=' 3 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/apache.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to apache server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | apache_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "Deploy cert to apache server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/dovecot.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to dovecot server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | dovecot_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/haproxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to haproxy server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | haproxy_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "deploy cert to haproxy server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/keychain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a sample custom api script. 4 | #This file name is "myapi.sh" 5 | #So, here must be a method myapi_deploy() 6 | #Which will be called by acme.sh to deploy the cert 7 | #returns 0 means success, otherwise error. 8 | 9 | ######## Public functions ##################### 10 | 11 | #domain keyfile certfile cafile fullchain 12 | keychain_deploy() { 13 | _cdomain="$1" 14 | _ckey="$2" 15 | _ccert="$3" 16 | _cca="$4" 17 | _cfullchain="$5" 18 | 19 | _debug _cdomain "$_cdomain" 20 | _debug _ckey "$_ckey" 21 | _debug _ccert "$_ccert" 22 | _debug _cca "$_cca" 23 | _debug _cfullchain "$_cfullchain" 24 | 25 | /usr/bin/security import "$_ckey" -k "/Library/Keychains/System.keychain" 26 | /usr/bin/security import "$_ccert" -k "/Library/Keychains/System.keychain" 27 | /usr/bin/security import "$_cca" -k "/Library/Keychains/System.keychain" 28 | /usr/bin/security import "$_cfullchain" -k "/Library/Keychains/System.keychain" 29 | 30 | return 0 31 | } 32 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/myapi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a sample custom api script. 4 | #This file name is "myapi.sh" 5 | #So, here must be a method myapi_deploy() 6 | #Which will be called by acme.sh to deploy the cert 7 | #returns 0 means success, otherwise error. 8 | 9 | ######## Public functions ##################### 10 | 11 | #domain keyfile certfile cafile fullchain 12 | myapi_deploy() { 13 | _cdomain="$1" 14 | _ckey="$2" 15 | _ccert="$3" 16 | _cca="$4" 17 | _cfullchain="$5" 18 | 19 | _debug _cdomain "$_cdomain" 20 | _debug _ckey "$_ckey" 21 | _debug _ccert "$_ccert" 22 | _debug _cca "$_cca" 23 | _debug _cfullchain "$_cfullchain" 24 | 25 | _err "Not implemented yet" 26 | return 1 27 | 28 | } 29 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/mysqld.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to mysqld server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | mysqld_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "deploy cert to mysqld server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/nginx.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to nginx server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | nginx_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "deploy cert to nginx server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/opensshd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to opensshd server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | opensshd_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "deploy cert to opensshd server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/pureftpd.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a script to deploy cert to pureftpd server. 4 | 5 | #returns 0 means success, otherwise error. 6 | 7 | ######## Public functions ##################### 8 | 9 | #domain keyfile certfile cafile fullchain 10 | pureftpd_deploy() { 11 | _cdomain="$1" 12 | _ckey="$2" 13 | _ccert="$3" 14 | _cca="$4" 15 | _cfullchain="$5" 16 | 17 | _debug _cdomain "$_cdomain" 18 | _debug _ckey "$_ckey" 19 | _debug _ccert "$_ccert" 20 | _debug _cca "$_cca" 21 | _debug _cfullchain "$_cfullchain" 22 | 23 | _err "deploy cert to pureftpd server, Not implemented yet" 24 | return 1 25 | 26 | } 27 | -------------------------------------------------------------------------------- /install/acme.sh/deploy/strongswan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a sample custom api script. 4 | #This file name is "myapi.sh" 5 | #So, here must be a method myapi_deploy() 6 | #Which will be called by acme.sh to deploy the cert 7 | #returns 0 means success, otherwise error. 8 | 9 | ######## Public functions ##################### 10 | 11 | #domain keyfile certfile cafile fullchain 12 | strongswan_deploy() { 13 | _cdomain="$1" 14 | _ckey="$2" 15 | _ccert="$3" 16 | _cca="$4" 17 | _cfullchain="$5" 18 | 19 | _debug _cdomain "$_cdomain" 20 | _debug _ckey "$_ckey" 21 | _debug _ccert "$_ccert" 22 | _debug _cca "$_cca" 23 | _debug _cfullchain "$_cfullchain" 24 | 25 | cat "$_ckey" >"/etc/ipsec.d/private/$(basename "$_ckey")" 26 | cat "$_ccert" >"/etc/ipsec.d/certs/$(basename "$_ccert")" 27 | cat "$_cca" >"/etc/ipsec.d/cacerts/$(basename "$_cca")" 28 | cat "$_cfullchain" >"/etc/ipsec.d/cacerts/$(basename "$_cfullchain")" 29 | 30 | ipsec reload 31 | 32 | } 33 | -------------------------------------------------------------------------------- /install/acme.sh/dnsapi/dns_myapi.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | #Here is a sample custom api script. 4 | #This file name is "dns_myapi.sh" 5 | #So, here must be a method dns_myapi_add() 6 | #Which will be called by acme.sh to add the txt record to your api system. 7 | #returns 0 means success, otherwise error. 8 | # 9 | #Author: Neilpang 10 | #Report Bugs here: https://github.com/Neilpang/acme.sh 11 | # 12 | ######## Public functions ##################### 13 | 14 | #Usage: dns_myapi_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" 15 | dns_myapi_add() { 16 | fulldomain=$1 17 | txtvalue=$2 18 | _info "Using myapi" 19 | _debug fulldomain "$fulldomain" 20 | _debug txtvalue "$txtvalue" 21 | _err "Not implemented!" 22 | return 1 23 | } 24 | 25 | #Usage: fulldomain txtvalue 26 | #Remove the txt record after validation. 27 | dns_myapi_rm() { 28 | fulldomain=$1 29 | txtvalue=$2 30 | _info "Using myapi" 31 | _debug fulldomain "$fulldomain" 32 | _debug txtvalue "$txtvalue" 33 | } 34 | 35 | #################### Private functions below ################################## 36 | -------------------------------------------------------------------------------- /install/acme.sh/http.header: -------------------------------------------------------------------------------- 1 | HTTP/1.1 200 OK 2 | Server: nginx 3 | Content-Type: application/pkix-cert 4 | Content-Length: 1174 5 | Replay-Nonce: 3R9I7eT6AlfpDUHpq__mviMJhcHD0FMi4QxZUr6rn2o 6 | X-Frame-Options: DENY 7 | Strict-Transport-Security: max-age=604800 8 | Expires: Thu, 13 Dec 2018 00:29:09 GMT 9 | Cache-Control: max-age=0, no-cache, no-store 10 | Pragma: no-cache 11 | Date: Thu, 13 Dec 2018 00:29:09 GMT 12 | Connection: keep-alive 13 | 14 | -------------------------------------------------------------------------------- /install/acme.sh/issue.sh: -------------------------------------------------------------------------------- 1 | ./acme.sh --issue --standalone -d az-demo.shwrfr.com 2 | -------------------------------------------------------------------------------- /install/acme.sh/renewal.sh: -------------------------------------------------------------------------------- 1 | ./acme.sh -r -d az-demo.shwrfr.com --force 2 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/.gitignore: -------------------------------------------------------------------------------- 1 | autom4te.cache 2 | *~ 3 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/Problems: -------------------------------------------------------------------------------- 1 | Possible reasons why at may not run for you: 2 | 3 | - HAVE you run ./configure ? If that fails for some 4 | mysterious reasons, you can also do a 5 | 6 | make -f Makefile.old install 7 | 8 | - You may not have a user or group 'daemon' on your system. 9 | 10 | - If you find numerous 'try again' error messages in your syslog files, 11 | you have too many processes running; recompile your kernel for a 12 | larger number 13 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/README: -------------------------------------------------------------------------------- 1 | This is version of 3.1.x of at, for running commands at a 2 | specified time. To install, do a 3 | 4 | $ ./configure 5 | 6 | You might want to change the default maximum load at which batch 7 | jobs are still started by specifying --with-loadavg_mx=... as 8 | argument to configure. The default is 0.8, so that, normally, no 9 | batch job will be started when there's still activity going on. 10 | For an SMP system, you will want to increase this. 11 | 12 | Then, do 13 | 14 | $ make 15 | 16 | and, as root, 17 | 18 | # make install 19 | 20 | at jobs are run by the atd daemon, which is normally started at boot 21 | time. 22 | 23 | Bug reports to: 24 | http://bugs.debian.org/ (Debian bug tracking system) 25 | or 26 | at@packages.debian.org (Debian at package maintainers) 27 | 28 | If at all possible, I'd appreciate you telling me which version you 29 | found a bug in; run at -V to find out which one. 30 | 31 | The Homepage and place for news is at: 32 | http://blog.calhariz.com/tag/at 33 | 34 | The latest source code and old relases are available at the git repository: 35 | https://anonscm.debian.org/git/collab-maint/at.git/ 36 | 37 | If you need to contact the developer of the software please use: 38 | jose (at) calhariz.com 39 | 40 | If you try to use at(1) on a system which does not support setreuid(2), 41 | i.e. if you get an error whch looks vaguely like 42 | 43 | undefined symbol _setreuid referenced from text segment 44 | 45 | DO NOT try to install at on your system by removing all that strange 46 | PRIV stuff. You will install a rather glaring security hole that way. 47 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/at.allow.5.in: -------------------------------------------------------------------------------- 1 | .TH AT.ALLOW 5 "Sep 1997" "" "Linux Programmer's Manual" 2 | .SH NAME 3 | at.allow, at.deny \- determine who can submit jobs via at or batch 4 | .SH DESCRIPTION 5 | The 6 | .I /etc/at.allow 7 | and 8 | .I /etc/at.deny 9 | files determine which user can submit commands for later execution via 10 | .BR at (1) 11 | or 12 | .BR batch (1) . 13 | .PP 14 | The format of the files is a list of usernames, one on each line. Whitespace 15 | is not permitted. 16 | .PP 17 | If the file 18 | .I @ETCDIR@/at.allow 19 | exists, only usernames mentioned in it are allowed to use 20 | .BR at . 21 | .PP 22 | If 23 | .I @ETCDIR@/at.allow 24 | does not exist, 25 | .I @ETCDIR@/at.deny 26 | is checked, every username not mentioned in it is then allowed 27 | to use 28 | .BR at . 29 | .PP 30 | An empty 31 | .I @ETCDIR@/at.deny 32 | means that every user may use 33 | .BR at . 34 | .PP 35 | If neither exists, only the superuser is allowed to use at. 36 | .SH "SEE ALSO" 37 | .BR at (1), 38 | .BR cron (8), 39 | .BR crontab (1), 40 | .BR atd (8). 41 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/at.deny: -------------------------------------------------------------------------------- 1 | alias 2 | backup 3 | bin 4 | daemon 5 | ftp 6 | games 7 | gnats 8 | guest 9 | irc 10 | lp 11 | mail 12 | man 13 | nobody 14 | operator 15 | proxy 16 | qmaild 17 | qmaill 18 | qmailp 19 | qmailq 20 | qmailr 21 | qmails 22 | sync 23 | sys 24 | www-data 25 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/at.h: -------------------------------------------------------------------------------- 1 | /* 2 | * at.h - header for at(1) 3 | * Copyright (C) 1993 Thomas Koenig 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | extern int fcreated; 21 | extern char *namep; 22 | extern char atfile[]; 23 | extern char atverify; 24 | 25 | void *mymalloc(size_t n); 26 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/atd.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Deferred execution scheduler 3 | Documentation=man:atd(8) 4 | After=remote-fs.target nss-user-lookup.target 5 | 6 | [Service] 7 | ExecStartPre=-find @atjobdir@ -type f -name "=*" -not -newercc /run/systemd -delete 8 | ExecStart=@sbindir@/atd -f 9 | IgnoreSIGPIPE=false 10 | KillMode=process 11 | Restart=on-failure 12 | 13 | [Install] 14 | WantedBy=multi-user.target 15 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/atrun.8.in: -------------------------------------------------------------------------------- 1 | .TH ATRUN 8 "Nov 1996" local "Linux Programmer's Manual" 2 | .SH NAME 3 | atrun \- run jobs queued for later execution 4 | .SH SYNOPSIS 5 | .B atrun 6 | .RB [ -l 7 | .IR load_avg ] 8 | .RB [ -d ] 9 | .SH DESCRIPTION 10 | .B atrun 11 | runs jobs queued by 12 | .BR at(1) . 13 | It is a shell script invoking 14 | .B @sbindir@/atd 15 | with the 16 | .I -s 17 | option, and is provided for backward compatibility with older 18 | installations. 19 | .SH SEE ALSO 20 | .BR at (1), 21 | .BR atd (8). 22 | .SH AUTHOR 23 | At was mostly written by Thomas Koenig. 24 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/atrun.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | prefix=@prefix@ 3 | exec_prefix=@exec_prefix@ 4 | exec @sbindir@/atd -s "$@" 5 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/batch.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh -e 2 | if [ "$#" -gt 0 ]; then 3 | echo batch accepts no parameters 4 | exit 1 5 | fi 6 | prefix=@prefix@ 7 | exec_prefix=@exec_prefix@ 8 | exec @bindir@/at -qb now 9 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/daemon.h: -------------------------------------------------------------------------------- 1 | void daemon_setup(void); 2 | void daemon_cleanup(void); 3 | 4 | void 5 | #ifdef HAVE_ATTRIBUTE_NORETURN 6 | __attribute__((noreturn)) 7 | #endif 8 | pabort (const char *fmt, ...); 9 | 10 | void 11 | #ifdef HAVE_ATTRIBUTE_NORETURN 12 | __attribute__((noreturn)) 13 | #endif 14 | perr (const char *fmt, ...); 15 | 16 | void 17 | lerr (const char *fmt, ...); 18 | 19 | extern int daemon_debug; 20 | extern int daemon_foreground; 21 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/dist: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | PACKNAME=at 5 | SOURCENAME=at 6 | VER=$( grep AC_INIT configure.ac | cut -d ',' -f 2 | tr -d ' )' ) 7 | RELTAR=${SOURCENAME}_$VER.orig.tar.gz 8 | 9 | echo $PACKNAME $SOURCENAME $VER 10 | echo $RELTAR 11 | 12 | [ ! -e ../$SOURCENAME-$VER ] || ( echo "Dir $SOURCENAME-$VER exist, aborting" ; exit 1 ) 13 | [ ! -e ../$RELTAR ] || ( echo "Release file $RELTAR exist, aborting" ; exit 2 ) 14 | mkdir ../$SOURCENAME-$VER 15 | fakeroot tar --exclude=debian --exclude=.git -cf - . | tar -C ../$SOURCENAME-$VER -x 16 | GZIP=-9 fakeroot tar -C .. -czf ../$RELTAR $SOURCENAME-$VER 17 | rm -r ../$SOURCENAME-$VER 18 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/getloadavg.h: -------------------------------------------------------------------------------- 1 | int getloadavg(double *result, int n); 2 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/pam.conf: -------------------------------------------------------------------------------- 1 | # 2 | # The PAM configuration file for the at daemon 3 | # 4 | 5 | @include common-auth 6 | @include common-account 7 | session required pam_loginuid.so 8 | @include common-session-noninteractive 9 | session required pam_limits.so 10 | auth required pam_env.so user_readenv=1 11 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/panic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * panic.h - header for at(1) 3 | * Copyright (C) 1993 Thomas Koenig 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | void 21 | #ifdef HAVE_ATTRIBUTE_NORETURN 22 | __attribute__((noreturn)) 23 | #endif 24 | panic(char *a); 25 | void 26 | #ifdef HAVE_ATTRIBUTE_NORETURN 27 | __attribute__((noreturn)) 28 | #endif 29 | perr(const char *a, ...); 30 | void 31 | #ifdef HAVE_ATTRIBUTE_NORETURN 32 | __attribute__((noreturn)) 33 | #endif 34 | usage(void); 35 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/parsetime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * at.h - header for at(1) 3 | * Copyright (C) 1993 Thomas Koenig 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | time_t parsetime(time_t currtime, int argc, char **argv); 21 | 22 | extern char *last_token; 23 | extern char **my_argv; 24 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/perm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * perm.h - header for at(1) 3 | * Copyright (C) 1994 Thomas Koenig 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | int check_permission(); 21 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/posixtm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is taken from coreutils 7.4 3 | */ 4 | 5 | /* Parse dates for touch and date. 6 | 7 | Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc. 8 | 9 | This program is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU General Public License for more details. 18 | 19 | You should have received a copy of the GNU General Public License 20 | along with this program. If not, see . */ 21 | 22 | /* Yacc-based version written by Jim Kingdon and David MacKenzie. 23 | Rewritten by Jim Meyering. */ 24 | 25 | #ifndef POSIXTM_H_ 26 | # define POSIXTM_H_ 27 | 28 | # include 29 | # include 30 | 31 | /* POSIX Date Syntax flags. */ 32 | # define PDS_LEADING_YEAR 1 33 | # define PDS_TRAILING_YEAR 2 34 | # define PDS_CENTURY 4 35 | # define PDS_SECONDS 8 36 | # define PDS_PRE_2000 16 37 | 38 | bool posixtime (time_t *p, const char *s, unsigned int syntax_bits); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/rc: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: atd 4 | # Required-Start: $syslog $time $remote_fs 5 | # Required-Stop: $syslog $time $remote_fs 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 0 1 6 8 | # Short-Description: Deferred execution scheduler 9 | # Description: Debian init script for the atd deferred executions 10 | # scheduler 11 | ### END INIT INFO 12 | # 13 | # Author: Ryan Murray 14 | # 15 | 16 | PATH=/bin:/usr/bin:/sbin:/usr/sbin 17 | DAEMON=/usr/sbin/atd 18 | PIDFILE=/var/run/atd.pid 19 | 20 | test -x $DAEMON || exit 0 21 | 22 | . /lib/lsb/init-functions 23 | 24 | case "$1" in 25 | start) 26 | log_daemon_msg "Starting deferred execution scheduler" "atd" 27 | start_daemon -p $PIDFILE $DAEMON 28 | log_end_msg $? 29 | ;; 30 | stop) 31 | log_daemon_msg "Stopping deferred execution scheduler" "atd" 32 | killproc -p $PIDFILE $DAEMON 33 | log_end_msg $? 34 | ;; 35 | force-reload|restart) 36 | $0 stop 37 | $0 start 38 | ;; 39 | status) 40 | status_of_proc -p $PIDFILE $DAEMON atd && exit 0 || exit $? 41 | ;; 42 | *) 43 | echo "Usage: /etc/init.d/atd {start|stop|restart|force-reload|status}" 44 | exit 1 45 | ;; 46 | esac 47 | 48 | exit 0 49 | -------------------------------------------------------------------------------- /install/at-package/at-3.1.23/release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(grep AC_INIT configure.ac | cut -f 2 -d , | tr -d ")" | tr -d " ") 6 | echo "Going to release version: $VERSION" 7 | echo "Press enter to continue:" 8 | read enter 9 | autoconf 10 | if ! git diff --exit-code ; then 11 | echo 12 | echo "Changes present, please commit before continue" 13 | exit 1 14 | fi 15 | git tag -u $DEBSIGN_KEYID --message "Release $VERSION" release/$VERSION 16 | git archive --format=tar --prefix=at-$VERSION/ --output=../at_$VERSION.orig.tar release/$VERSION 17 | gzip -v9 ../at_$VERSION.orig.tar 18 | git checkout debian 19 | gbp import-orig --verbose --keyid=$DEBSIGN_KEYID -u$VERSION --pristine-tar ../at_$VERSION.orig.tar.gz 20 | -------------------------------------------------------------------------------- /install/at-package/at_3.1.23.orig.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/at-package/at_3.1.23.orig.tar.gz -------------------------------------------------------------------------------- /install/containers/docker-elasticsearch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docker.elastic.co/elasticsearch/elasticsearch:6.6.0 2 | 3 | #COPY --chown=elasticsearch:elasticsearch elasticsearch.yml /usr/share/elasticsearch/config/ 4 | -------------------------------------------------------------------------------- /install/containers/docker-elasticsearch/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=elasticsearch 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/volumes/${CONTAINER_NAME} 4 | 5 | build: Dockerfile 6 | docker build -t $(IMAGE_NAME) . 7 | 8 | start: 9 | docker run -d -p 9200:9200 -p 9300:9300 --dns 172.16.100.50 \ 10 | -v ${VOLUME}:/usr/share/elasticsearch/data \ 11 | -e "discovery.type=single-node" \ 12 | --name ${CONTAINER_NAME} \ 13 | ${IMAGE_NAME} 14 | 15 | stop: 16 | docker stop $(CONTAINER_NAME) 17 | docker rm $(CONTAINER_NAME) 18 | 19 | clean: 20 | docker rmi $(IMAGE_NAME) 21 | docker images 22 | 23 | clean-volume: 24 | rm -fr $(VOLUME)/{*,.??*} 25 | 26 | -------------------------------------------------------------------------------- /install/containers/docker-elasticsearch/README.md: -------------------------------------------------------------------------------- 1 | # docker-elasticsearch 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/containers/docker-grafana/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM grafana/grafana 2 | -------------------------------------------------------------------------------- /install/containers/docker-grafana/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=grafana 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/volumes/${CONTAINER_NAME} 4 | 5 | build: Dockerfile 6 | docker build -t $(IMAGE_NAME) . 7 | 8 | start: 9 | docker run -d -p 3000:3000 --dns 172.16.100.50 \ 10 | -v ${VOLUME}:/var/lib/grafana \ 11 | -e "GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource" \ 12 | -e "GF_SECURITY_ADMIN_PASSWORD=secret" \ 13 | --name ${CONTAINER_NAME} \ 14 | ${IMAGE_NAME} 15 | 16 | stop: 17 | docker stop $(CONTAINER_NAME) 18 | docker rm $(CONTAINER_NAME) 19 | 20 | clean: 21 | docker rmi $(IMAGE_NAME) 22 | docker images 23 | 24 | clean-volume: 25 | rm -fr $(VOLUME)/{*,.??*} 26 | 27 | -------------------------------------------------------------------------------- /install/containers/docker-grafana/README.md: -------------------------------------------------------------------------------- 1 | # docker-grafana 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER Brice Dereims "bdereims@gmail.com" 3 | 4 | # Install HAProxy 5 | RUN apk update && apk upgrade && \ 6 | apk add haproxy 7 | 8 | # Add HAProxy default config 9 | ADD haproxy/conf/. /etc/haproxy/. 10 | RUN mkdir -p /var/lib/haproxy \ 11 | && chown -R haproxy:haproxy /var/lib/haproxy \ 12 | && chmod 600 /etc/haproxy/* 13 | 14 | ADD ./startup.sh /opt/startup.sh 15 | 16 | EXPOSE 80 443 1936 17 | 18 | CMD ["/bin/sh", "/opt/startup.sh"] 19 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=haproxy 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME= 4 | 5 | build: Dockerfile 6 | ./update-pem.sh 7 | docker build -t $(IMAGE_NAME) . 8 | 9 | start: 10 | docker run -d \ 11 | --net=host \ 12 | --name $(CONTAINER_NAME) $(IMAGE_NAME) 13 | 14 | stop: 15 | docker stop $(CONTAINER_NAME) 16 | docker rm $(CONTAINER_NAME) 17 | 18 | clean: 19 | docker rmi $(IMAGE_NAME) 20 | docker images 21 | 22 | clean-volume: 23 | rm -fr $(VOLUME)/{*,.??*} 24 | 25 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/README.md: -------------------------------------------------------------------------------- 1 | # docker-haproxy 2 | 3 | HAproxy container for mutiplexing SSH, HTTPS and OpenVPN over TCP/443 4 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/400.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 400 Bad request 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

400 Bad request

7 | Your browser sent an invalid request. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/403.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 403 Forbidden 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

403 Forbidden

7 | Request forbidden by administrative rules. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/408.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 408 Request Time-out 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

408 Request Time-out

7 | Your browser didn't send a complete request in time. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/500.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 500 Server Error 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

500 Server Error

7 | An internal server error occured. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/502.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 502 Bad Gateway 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

502 Bad Gateway

7 | The server returned an invalid or incomplete response. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/503.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 503 Service Unavailable 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

503 Service Unavailable

7 | No server is available to handle this request. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/conf/errors/504.http: -------------------------------------------------------------------------------- 1 | HTTP/1.0 504 Gateway Time-out 2 | Cache-Control: no-cache 3 | Connection: close 4 | Content-Type: text/html 5 | 6 |

504 Gateway Time-out

7 | The server didn't respond in time. 8 | 9 | 10 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

* <--- you are here!

4 | 5 | 6 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/haproxy/html/owncloud/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #/usr/sbin/apache2ctl start 4 | /usr/sbin/haproxy -d -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid 5 | -------------------------------------------------------------------------------- /install/containers/docker-haproxy/update-pem.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | PEM_FILE=haproxy/conf/cpodedge.pem 4 | #DOMAIN=az-lab.shwrfr.com 5 | DOMAIN=shwrfr.com 6 | ACME=~/.acme.sh/${DOMAIN} 7 | 8 | cat ${ACME}/fullchain.cer ${ACME}/${DOMAIN}.key > ${PEM_FILE} 9 | -------------------------------------------------------------------------------- /install/containers/docker-node-exporter/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM quay.io/prometheus/node-exporter 2 | -------------------------------------------------------------------------------- /install/containers/docker-node-exporter/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=node-exporter 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/volumes/${CONTAINER_NAME} 4 | 5 | build: Dockerfile 6 | docker build -t $(IMAGE_NAME) . 7 | 8 | start: 9 | docker run -d --dns 172.16.100.50 \ 10 | --net="host" \ 11 | --pid="host" \ 12 | -v "/:/host:ro,rslave" \ 13 | --name ${CONTAINER_NAME} \ 14 | ${IMAGE_NAME} \ 15 | --path.rootfs /host 16 | 17 | stop: 18 | docker stop $(CONTAINER_NAME) 19 | docker rm $(CONTAINER_NAME) 20 | 21 | clean: 22 | docker rmi $(IMAGE_NAME) 23 | docker images 24 | 25 | clean-volume: 26 | rm -fr $(VOLUME)/{*,.??*} 27 | 28 | -------------------------------------------------------------------------------- /install/containers/docker-node-exporter/README.md: -------------------------------------------------------------------------------- 1 | # docker-node-exporter 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | MAINTAINER Brice Dereims "bdereims@gmail.com" 3 | 4 | # Install OpenVPN 5 | RUN apk update && apk upgrade && \ 6 | apk add openvpn openssl 7 | 8 | # Add OpenVPN default config 9 | ADD openvpn/. /etc/openvpn/. 10 | RUN mkdir -p /run/openvpn 11 | 12 | ADD ./startup.sh /opt/startup.sh 13 | 14 | EXPOSE 1194 15 | 16 | CMD ["/bin/sh", "/opt/startup.sh"] 17 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=openvpn 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME= 4 | 5 | build: Dockerfile 6 | bash generate-conf.sh 7 | docker build -t $(IMAGE_NAME) . 8 | 9 | start: 10 | docker run -d \ 11 | --net=host \ 12 | --device=/dev/net/tun \ 13 | --cap-add=NET_ADMIN \ 14 | --name $(CONTAINER_NAME) $(IMAGE_NAME) 15 | 16 | stop: 17 | docker stop $(CONTAINER_NAME) 18 | docker rm $(CONTAINER_NAME) 19 | 20 | clean: 21 | docker rmi $(IMAGE_NAME) 22 | docker images 23 | 24 | clean-volume: 25 | rm -fr $(VOLUME)/{*,.??*} 26 | 27 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/README.md: -------------------------------------------------------------------------------- 1 | # docker-haproxy 2 | 3 | HAproxy container for mutiplexing SSH, HTTPS and OpenVPN over TCP/443 4 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/generate-conf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | pushd ~/cPodFactory 5 | . ./env 6 | popd 7 | 8 | cd openvpn 9 | eval "echo \"$(cat server.conf-template)\"" > server.conf 10 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/ccd/client: -------------------------------------------------------------------------------- 1 | #iroute 172.21.0.0 255.255.0.0 2 | #iroute 172.16.4.0 255.255.255.0 3 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-ca: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Build a root certificate 5 | # 6 | 7 | export EASY_RSA="${EASY_RSA:-.}" 8 | "$EASY_RSA/pkitool" --interact --initca $* 9 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-dh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build Diffie-Hellman parameters for the server side 4 | # of an SSL/TLS connection. 5 | 6 | if [ -d $KEY_DIR ] && [ $KEY_SIZE ]; then 7 | $OPENSSL dhparam -out ${KEY_DIR}/dh${KEY_SIZE}.pem ${KEY_SIZE} 8 | else 9 | echo 'Please source the vars script first (i.e. "source ./vars")' 10 | echo 'Make sure you have edited it to reflect your configuration.' 11 | fi 12 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-inter: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make an intermediate CA certificate/private key pair using a locally generated 4 | # root certificate. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact --inter $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-key: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make a certificate/private key pair using a locally generated 4 | # root certificate. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-key-pass: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Similar to build-key, but protect the private key 4 | # with a password. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact --pass $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-key-pkcs12: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make a certificate/private key pair using a locally generated 4 | # root certificate and convert it to a PKCS #12 file including the 5 | # the CA certificate as well. 6 | 7 | export EASY_RSA="${EASY_RSA:-.}" 8 | "$EASY_RSA/pkitool" --interact --pkcs12 $* 9 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-key-server: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make a certificate/private key pair using a locally generated 4 | # root certificate. 5 | # 6 | # Explicitly set nsCertType to server using the "server" 7 | # extension in the openssl.cnf file. 8 | 9 | export EASY_RSA="${EASY_RSA:-.}" 10 | "$EASY_RSA/pkitool" --interact --server $* 11 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-req: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build a certificate signing request and private key. Use this 4 | # when your root certificate and key is not available locally. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact --csr $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/build-req-pass: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Like build-req, but protect your private key 4 | # with a password. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact --csr --pass $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/clean-all: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Initialize the $KEY_DIR directory. 4 | # Note that this script does a 5 | # rm -rf on $KEY_DIR so be careful! 6 | 7 | if [ "$KEY_DIR" ]; then 8 | rm -rf "$KEY_DIR" 9 | mkdir "$KEY_DIR" && \ 10 | chmod go-rwx "$KEY_DIR" && \ 11 | touch "$KEY_DIR/index.txt" && \ 12 | echo 01 >"$KEY_DIR/serial" 13 | else 14 | echo 'Please source the vars script first (i.e. "source ./vars")' 15 | echo 'Make sure you have edited it to reflect your configuration.' 16 | fi 17 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/inherit-inter: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Build a new PKI which is rooted on an intermediate certificate generated 4 | # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should 5 | # have independent vars settings, and must use a different KEY_DIR directory 6 | # from the parent. This tool can be used to generate arbitrary depth 7 | # certificate chains. 8 | # 9 | # To build an intermediate CA, follow the same steps for a regular PKI but 10 | # replace ./build-key or ./pkitool --initca with this script. 11 | 12 | # The EXPORT_CA file will contain the CA certificate chain and should be 13 | # referenced by the OpenVPN "ca" directive in config files. The ca.crt file 14 | # will only contain the local intermediate CA -- it's needed by the easy-rsa 15 | # scripts but not by OpenVPN directly. 16 | EXPORT_CA="export-ca.crt" 17 | 18 | if [ $# -ne 2 ]; then 19 | echo "usage: $0 " 20 | echo "parent-key-dir: the KEY_DIR directory of the parent PKI" 21 | echo "common-name: the common name of the intermediate certificate in the parent PKI" 22 | exit 1; 23 | fi 24 | 25 | if [ "$KEY_DIR" ]; then 26 | cp "$1/$2.crt" "$KEY_DIR/ca.crt" 27 | cp "$1/$2.key" "$KEY_DIR/ca.key" 28 | 29 | if [ -e "$1/$EXPORT_CA" ]; then 30 | PARENT_CA="$1/$EXPORT_CA" 31 | else 32 | PARENT_CA="$1/ca.crt" 33 | fi 34 | cp "$PARENT_CA" "$KEY_DIR/$EXPORT_CA" 35 | cat "$KEY_DIR/ca.crt" >> "$KEY_DIR/$EXPORT_CA" 36 | else 37 | echo 'Please source the vars script first (i.e. "source ./vars")' 38 | echo 'Make sure you have edited it to reflect your configuration.' 39 | fi 40 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/list-crl: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # list revoked certificates 4 | 5 | CRL="${1:-crl.pem}" 6 | 7 | if [ "$KEY_DIR" ]; then 8 | cd "$KEY_DIR" && \ 9 | $OPENSSL crl -text -noout -in "$CRL" 10 | else 11 | echo 'Please source the vars script first (i.e. "source ./vars")' 12 | echo 'Make sure you have edited it to reflect your configuration.' 13 | fi 14 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/revoke-full: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # revoke a certificate, regenerate CRL, 4 | # and verify revocation 5 | 6 | CRL="crl.pem" 7 | RT="revoke-test.pem" 8 | 9 | if [ $# -ne 1 ]; then 10 | echo "usage: revoke-full "; 11 | exit 1 12 | fi 13 | 14 | if [ "$KEY_DIR" ]; then 15 | cd "$KEY_DIR" 16 | rm -f "$RT" 17 | 18 | # set defaults 19 | export KEY_CN="" 20 | export KEY_OU="" 21 | export KEY_NAME="" 22 | 23 | # required due to hack in openssl.cnf that supports Subject Alternative Names 24 | export KEY_ALTNAMES="" 25 | 26 | # revoke key and generate a new CRL 27 | $OPENSSL ca -revoke "$1.crt" -config "$KEY_CONFIG" 28 | 29 | # generate a new CRL -- try to be compatible with 30 | # intermediate PKIs 31 | $OPENSSL ca -gencrl -out "$CRL" -config "$KEY_CONFIG" 32 | if [ -e export-ca.crt ]; then 33 | cat export-ca.crt "$CRL" >"$RT" 34 | else 35 | cat ca.crt "$CRL" >"$RT" 36 | fi 37 | 38 | # verify the revocation 39 | $OPENSSL verify -CAfile "$RT" -crl_check "$1.crt" 40 | else 41 | echo 'Please source the vars script first (i.e. "source ./vars")' 42 | echo 'Make sure you have edited it to reflect your configuration.' 43 | fi 44 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/shwrfr-env.sh: -------------------------------------------------------------------------------- 1 | export KEY_COUNTRY="FR" 2 | export KEY_PROVINCE="IDF" 3 | export KEY_CITY="Paris" 4 | export KEY_ORG="Showroom" 5 | export KEY_EMAIL="shwrfr@gmail.com" 6 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/sign-req: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Sign a certificate signing request (a .csr file) 4 | # with a local root certificate and key. 5 | 6 | export EASY_RSA="${EASY_RSA:-.}" 7 | "$EASY_RSA/pkitool" --interact --sign $* 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/easy-rsa/whichopensslcnf: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | cnf="$1/openssl.cnf" 4 | 5 | if [ "$OPENSSL" ]; then 6 | if $OPENSSL version | grep -E "0\.9\.6[[:alnum:]]?" > /dev/null; then 7 | cnf="$1/openssl-0.9.6.cnf" 8 | elif $OPENSSL version | grep -E "0\.9\.8[[:alnum:]]?" > /dev/null; then 9 | cnf="$1/openssl-0.9.8.cnf" 10 | elif $OPENSSL version | grep -E "1\.0\.[[:digit:]][[:alnum:]]?" > /dev/null; then 11 | cnf="$1/openssl-1.0.0.cnf" 12 | else 13 | cnf="$1/openssl.cnf" 14 | fi 15 | fi 16 | 17 | echo $cnf 18 | 19 | if [ ! -r $cnf ]; then 20 | echo "**************************************************************" >&2 21 | echo " No $cnf file could be found" >&2 22 | echo " Further invocations will fail" >&2 23 | echo "**************************************************************" >&2 24 | fi 25 | 26 | exit 0 27 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/make-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | 5 | [ "${1}" == "" ] && echo "usage: ${0} client_name" && exit 1 6 | 7 | 8 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/server.conf: -------------------------------------------------------------------------------- 1 | port 1195 2 | proto tcp 3 | dev tun0 4 | ca /etc/openvpn/easy-rsa/keys/ca.crt 5 | cert /etc/openvpn/easy-rsa/keys/cpodedge.crt 6 | key /etc/openvpn/easy-rsa/keys/cpodedge.key 7 | dh /etc/openvpn/easy-rsa/keys/dh2048.pem 8 | server 10.255.254.0 255.255.255.0 9 | ifconfig-pool-persist ipp.txt 10 | push "route 10.0.0.0 255.0.0.0" 11 | push "route 172.16.0.0 255.240.0.0" 12 | push "route 192.168.0.0 255.255.0.0" 13 | push "route 10.1.0.160 255.255.255.255" 14 | push "dhcp-option DNS 10.1.0.160" 15 | push "dhcp-option DOMAIN az-lab.shwrfr.com" 16 | client-to-client 17 | duplicate-cn 18 | keepalive 10 120 19 | max-clients 250 20 | persist-key 21 | persist-tun 22 | verb 0 23 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/server.conf-az-demo: -------------------------------------------------------------------------------- 1 | port 1195 2 | proto tcp 3 | dev tun0 4 | ca /etc/openvpn/easy-rsa/keys/ca.crt 5 | cert /etc/openvpn/easy-rsa/keys/cpodedge.crt 6 | dh /etc/openvpn/easy-rsa/keys/dh2048.pem 7 | server 10.255.254.0 255.255.255.0 8 | ifconfig-pool-persist ipp.txt 9 | push "route 10.0.0.0 255.0.0.0" 10 | push "route 172.16.100.20 255.255.255.255" 11 | push "route 172.16.0.0 255.240.0.0" 12 | push "route 192.168.0.0 255.255.0.0" 13 | push "route 10.1.0.150 255.255.255.255" 14 | push "dhcp-option DNS 10.1.0.150" 15 | push "dhcp-option DOMAIN az-demo.shwrfr.com" 16 | client-to-client 17 | duplicate-cn 18 | keepalive 10 120 19 | max-clients 250 20 | persist-key 21 | persist-tun 22 | verb 0 23 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/server.conf-az-lab: -------------------------------------------------------------------------------- 1 | port 1195 2 | proto tcp 3 | dev tun0 4 | ca /etc/openvpn/easy-rsa/keys/ca.crt 5 | cert /etc/openvpn/easy-rsa/keys/cpodedge.crt 6 | dh /etc/openvpn/easy-rsa/keys/dh2048.pem 7 | server 10.255.254.0 255.255.255.0 8 | ifconfig-pool-persist ipp.txt 9 | push "route 10.0.0.0 255.0.0.0" 10 | push "route 172.16.0.0 255.240.0.0" 11 | push "route 192.168.0.0 255.255.0.0" 12 | push "route 10.1.0.160 255.255.255.255" 13 | push "dhcp-option DNS 10.1.0.160" 14 | push "dhcp-option DOMAIN az-lab.shwrfr.com" 15 | client-to-client 16 | duplicate-cn 17 | keepalive 10 120 18 | max-clients 250 19 | persist-key 20 | persist-tun 21 | verb 0 22 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/server.conf-template: -------------------------------------------------------------------------------- 1 | port 1195 2 | proto tcp 3 | dev tun0 4 | ca /etc/openvpn/easy-rsa/keys/ca.crt 5 | cert /etc/openvpn/easy-rsa/keys/cpodedge.crt 6 | key /etc/openvpn/easy-rsa/keys/cpodedge.key 7 | dh /etc/openvpn/easy-rsa/keys/dh2048.pem 8 | server 10.255.254.0 255.255.255.0 9 | ifconfig-pool-persist ipp.txt 10 | push \"route 10.0.0.0 255.0.0.0\" 11 | push \"route 172.16.0.0 255.240.0.0\" 12 | push \"route 192.168.0.0 255.255.0.0\" 13 | push \"route ${ADDRIP} 255.255.255.255\" 14 | push \"dhcp-option DNS ${ADDRIP}\" 15 | push \"dhcp-option DOMAIN ${ROOT_DOMAIN}\" 16 | client-to-client 17 | duplicate-cn 18 | keepalive 10 120 19 | max-clients 250 20 | persist-key 21 | persist-tun 22 | verb 0 23 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/shwrfr-tunnelblick-client.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/containers/docker-openvpn/openvpn/shwrfr-tunnelblick-client.tgz -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/update-resolv-conf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Parses DHCP options from openvpn to update resolv.conf 4 | # To use set as 'up' and 'down' script in your openvpn *.conf: 5 | # up /etc/openvpn/update-resolv-conf 6 | # down /etc/openvpn/update-resolv-conf 7 | # 8 | # Used snippets of resolvconf script by Thomas Hood and Chris Hanson. 9 | # Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. 10 | # 11 | # Example envs set from openvpn: 12 | # 13 | # foreign_option_1='dhcp-option DNS 193.43.27.132' 14 | # foreign_option_2='dhcp-option DNS 193.43.27.133' 15 | # foreign_option_3='dhcp-option DOMAIN be.bnc.ch' 16 | # 17 | 18 | [ -x /sbin/resolvconf ] || exit 0 19 | [ "$script_type" ] || exit 0 20 | [ "$dev" ] || exit 0 21 | 22 | split_into_parts() 23 | { 24 | part1="$1" 25 | part2="$2" 26 | part3="$3" 27 | } 28 | 29 | case "$script_type" in 30 | up) 31 | NMSRVRS="" 32 | SRCHS="" 33 | for optionvarname in ${!foreign_option_*} ; do 34 | option="${!optionvarname}" 35 | echo "$option" 36 | split_into_parts $option 37 | if [ "$part1" = "dhcp-option" ] ; then 38 | if [ "$part2" = "DNS" ] ; then 39 | NMSRVRS="${NMSRVRS:+$NMSRVRS }$part3" 40 | elif [ "$part2" = "DOMAIN" ] ; then 41 | SRCHS="${SRCHS:+$SRCHS }$part3" 42 | fi 43 | fi 44 | done 45 | R="" 46 | [ "$SRCHS" ] && R="search $SRCHS 47 | " 48 | for NS in $NMSRVRS ; do 49 | R="${R}nameserver $NS 50 | " 51 | done 52 | echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn" 53 | ;; 54 | down) 55 | /sbin/resolvconf -d "${dev}.openvpn" 56 | ;; 57 | esac 58 | 59 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/openvpn/update-resolv-conf-orig: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Parses DHCP options from openvpn to update resolv.conf 4 | # To use set as 'up' and 'down' script in your openvpn *.conf: 5 | # up /etc/openvpn/update-resolv-conf 6 | # down /etc/openvpn/update-resolv-conf 7 | # 8 | # Used snippets of resolvconf script by Thomas Hood and Chris Hanson. 9 | # Licensed under the GNU GPL. See /usr/share/common-licenses/GPL. 10 | # 11 | # Example envs set from openvpn: 12 | # 13 | # foreign_option_1='dhcp-option DNS 193.43.27.132' 14 | # foreign_option_2='dhcp-option DNS 193.43.27.133' 15 | # foreign_option_3='dhcp-option DOMAIN be.bnc.ch' 16 | # 17 | 18 | [ -x /sbin/resolvconf ] || exit 0 19 | [ "$script_type" ] || exit 0 20 | [ "$dev" ] || exit 0 21 | 22 | split_into_parts() 23 | { 24 | part1="$1" 25 | part2="$2" 26 | part3="$3" 27 | } 28 | 29 | case "$script_type" in 30 | up) 31 | NMSRVRS="" 32 | SRCHS="" 33 | for optionvarname in ${!foreign_option_*} ; do 34 | option="${!optionvarname}" 35 | echo "$option" 36 | split_into_parts $option 37 | if [ "$part1" = "dhcp-option" ] ; then 38 | if [ "$part2" = "DNS" ] ; then 39 | NMSRVRS="${NMSRVRS:+$NMSRVRS }$part3" 40 | elif [ "$part2" = "DOMAIN" ] ; then 41 | SRCHS="${SRCHS:+$SRCHS }$part3" 42 | fi 43 | fi 44 | done 45 | R="" 46 | [ "$SRCHS" ] && R="search $SRCHS 47 | " 48 | for NS in $NMSRVRS ; do 49 | R="${R}nameserver $NS 50 | " 51 | done 52 | echo -n "$R" | /sbin/resolvconf -a "${dev}.openvpn" 53 | ;; 54 | down) 55 | /sbin/resolvconf -d "${dev}.openvpn" 56 | ;; 57 | esac 58 | 59 | -------------------------------------------------------------------------------- /install/containers/docker-openvpn/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /usr/sbin/openvpn --status /run/openvpn/server.status 10 --cd /etc/openvpn --config /etc/openvpn/server.conf --writepid /run/openvpn/server.pid 4 | -------------------------------------------------------------------------------- /install/containers/docker-prometheus/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM prom/prometheus 2 | 3 | ADD prometheus.yml /etc/prometheus/ 4 | -------------------------------------------------------------------------------- /install/containers/docker-prometheus/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=prometheus 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/volumes/${CONTAINER_NAME} 4 | 5 | build: Dockerfile 6 | docker build -t $(IMAGE_NAME) . 7 | 8 | start: 9 | docker run -d -p 9091:9090 --dns 172.16.100.50 \ 10 | -v ${VOLUME}:/prometheus-data \ 11 | --name ${CONTAINER_NAME} \ 12 | ${IMAGE_NAME} --config.file=/prometheus-data/prometheus.yml 13 | 14 | stop: 15 | docker stop $(CONTAINER_NAME) 16 | docker rm $(CONTAINER_NAME) 17 | 18 | clean: 19 | docker rmi $(IMAGE_NAME) 20 | docker images 21 | 22 | clean-volume: 23 | rm -fr $(VOLUME)/{*,.??*} 24 | 25 | -------------------------------------------------------------------------------- /install/containers/docker-prometheus/README.md: -------------------------------------------------------------------------------- 1 | # docker-prometheus 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/containers/docker-prometheus/prometheus.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 15s # By default, scrape targets every 15 seconds. 3 | 4 | # Attach these labels to any time series or alerts when communicating with 5 | # external systems (federation, remote storage, Alertmanager). 6 | external_labels: 7 | monitor: 'codelab-monitor' 8 | 9 | # A scrape configuration containing exactly one endpoint to scrape: 10 | # Here it's Prometheus itself. 11 | scrape_configs: 12 | # The job name is added as a label `job=` to any timeseries scraped from this config. 13 | - job_name: 'prometheus' 14 | 15 | # Override the global default and scrape targets from this job every 5 seconds. 16 | scrape_interval: 5s 17 | 18 | static_configs: 19 | - targets: ['localhost:9090'] 20 | 21 | - job_name: 'node_exporter' 22 | scrape_interval: 5s 23 | static_configs: 24 | - targets: ['az-lab.shwrfr.com:9100'] 25 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=strongswan 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/StrongSwan 4 | 5 | build: Dockerfile 6 | mkdir -p $(VOLUME) 7 | cp -R config $(VOLUME) 8 | docker build -t $(IMAGE_NAME) . 9 | 10 | start: 11 | docker run -d \ 12 | --cap-add=NET_ADMIN \ 13 | --net=host \ 14 | -v $(VOLUME)/config/strongswan.conf:/etc/strongswan.conf \ 15 | -v $(VOLUME)/config/ipsec.conf:/etc/ipsec.conf \ 16 | -v $(VOLUME)/config/ipsec.secrets:/etc/ipsec.secrets \ 17 | -v $(VOLUME)/config/ipsec.d:/etc/ipsec.d \ 18 | --name $(CONTAINER_NAME) $(IMAGE_NAME) 19 | 20 | stop: 21 | docker stop $(CONTAINER_NAME) 22 | docker rm $(CONTAINER_NAME) 23 | 24 | clean: 25 | docker rmi $(IMAGE_NAME) 26 | docker images 27 | 28 | clean-volume: 29 | rm -fr $(VOLUME)/{*,.??*} 30 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/ipsec.conf-orig: -------------------------------------------------------------------------------- 1 | config setup 2 | uniqueids=no 3 | 4 | conn %default 5 | keyexchange=ikev2 6 | ikelifetime=60m 7 | keylife=20m 8 | rekeymargin=3m 9 | keyingtries=1 10 | rekey=no 11 | ike=chacha20poly1305-prfsha256-newhope128,chacha20poly1305-prfsha256-ecp256,aes128gcm16-prfsha256-ecp256,aes256-sha256-modp2048,aes256-sha256-modp1024! 12 | esp=chacha20poly1305-newhope128,chacha20poly1305-ecp256,aes128gcm16-ecp256,aes256-sha256-modp2048,aes256-sha256,aes256-sha1! 13 | dpdaction=clear 14 | dpddelay=120s 15 | auto=add 16 | 17 | conn roadwarrior 18 | left=%any 19 | leftid=62.23.45.215 20 | leftauth=pubkey 21 | leftcert=serverCert.pem 22 | leftsendcert=always 23 | leftsubnet=0.0.0.0/0,::/0 24 | #leftupdown=/etc/ipsec.d/firewall.updown 25 | #leftfirewall=yes 26 | right=%any 27 | rightauth=pubkey 28 | #rightsourceip=%dhcp,fdef:a51d:f888::/112 29 | rightsourceip=192.168.12.0/24,fdef:a51d:f888::/112 30 | rightdns=8.8.8.8,2001:4860:4860::8888 31 | 32 | conn roadwarrior-eap 33 | also=roadwarrior 34 | rightauth=eap-dynamic 35 | eap_identity=%any 36 | 37 | conn roadwarrior-pubkey-eap 38 | also=roadwarrior 39 | rightauth2=eap-dynamic 40 | eap_identity=%any 41 | 42 | conn client 43 | left=62.23.45.215 44 | leftauth=eap 45 | leftsourceip=%config4,%config6 46 | rightauth=pubkey 47 | rightsubnet=0.0.0.0/0,::/0 48 | eap_identity=%identity 49 | 50 | conn home 51 | also=client 52 | leftid=carol 53 | right=az-demo.shwrfr.com 54 | rightid=@az-demo.shwrfr.com 55 | #rightsubnet=192.168.12.0/24 56 | 57 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/ipsec.d/clientCert.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/containers/docker-strongswan/config/ipsec.d/clientCert.p12 -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/ipsec.secrets: -------------------------------------------------------------------------------- 1 | 34.73.216.154 : PSK "secret" 2 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/ipsec.secrets-bkp: -------------------------------------------------------------------------------- 1 | : RSA "/etc/ipsec.d/private/serverKey.pem" 2 | brice : EAP "dereims" 3 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/ipsec.secrets-orig: -------------------------------------------------------------------------------- 1 | : RSA serverKey.pem 2 | carol : EAP "Ar3etTnp01qlpOgb" 3 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/config/strongswan.conf: -------------------------------------------------------------------------------- 1 | charon { 2 | send_vendor_id = yes 3 | dns1 = 172.16.100.20 4 | dns2 = 172.16.100.20 5 | plugins { 6 | eap-dynamic { 7 | preferred = mschapv2, tls, md5 8 | } 9 | dhcp { 10 | identity_lease = no 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /install/containers/docker-strongswan/generate_certs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | C=FR 4 | O=SHWRFR 5 | CA_CN=shwrfr.com 6 | SERVER_CN=az-demo.shwrfr.com 7 | SERVER_SAN=az-demo.shwrfr.com 8 | CLIENT_CN="bdereims@vmware.co" 9 | 10 | CONFIG_DIR=$PWD/config/ipsec.d 11 | IPSEC="docker run -it --rm=true -v $CONFIG_DIR:/etc/ipsec.d cpod/strongswan" 12 | 13 | mkdir -p $CONFIG_DIR/aacerts \ 14 | $CONFIG_DIR/acerts \ 15 | $CONFIG_DIR/cacerts \ 16 | $CONFIG_DIR/certs \ 17 | $CONFIG_DIR/crls \ 18 | $CONFIG_DIR/ocspcerts \ 19 | $CONFIG_DIR/private 20 | 21 | eval $IPSEC pki --gen --outform pem > $CONFIG_DIR/private/caKey.pem 22 | eval $IPSEC pki --self --in /etc/ipsec.d/private/caKey.pem --dn \"C=$C, O=$O, CN=$CA_CN\" --ca --outform pem > $CONFIG_DIR/cacerts/caCert.pem 23 | 24 | eval $IPSEC pki --gen --outform pem > $CONFIG_DIR/private/serverKey.pem 25 | eval $IPSEC pki --issue --in /etc/ipsec.d/private/serverKey.pem --type priv --cacert /etc/ipsec.d/cacerts/caCert.pem --cakey /etc/ipsec.d/private/caKey.pem --dn \"C=$C, O=$O, CN=$SERVER_CN\" --san=\"$SERVER_SAN\" --flag serverAuth --flag ikeIntermediate --outform pem > $CONFIG_DIR/certs/serverCert.pem 26 | 27 | eval $IPSEC pki --gen --outform pem > $CONFIG_DIR/private/clientKey.pem 28 | eval $IPSEC pki --issue --in /etc/ipsec.d/private/clientKey.pem --type priv --cacert /etc/ipsec.d/cacerts/caCert.pem --cakey /etc/ipsec.d/private/caKey.pem --dn \"C=$C, O=$O, CN=$CLIENT_CN\" --san=\"$CLIENT_CN\" --outform pem > $CONFIG_DIR/certs/clientCert.pem 29 | openssl pkcs12 -export -inkey $CONFIG_DIR/private/clientKey.pem -in $CONFIG_DIR/certs/clientCert.pem -name \"$CLIENT_CN\" -certfile $CONFIG_DIR/cacerts/caCert.pem -caname \"$CA_CN\" -out $CONFIG_DIR/clientCert.p12 30 | 31 | -------------------------------------------------------------------------------- /install/containers/docker-syncthing/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | RUN echo 'syncthing:x:1000:1000::/var/syncthing:/sbin/nologin' >> /etc/passwd \ 4 | && echo 'syncthing:!::0:::::' >> /etc/shadow \ 5 | && mkdir /var/syncthing \ 6 | && chown syncthing /var/syncthing 7 | 8 | RUN apk add --update curl && \ 9 | rm -rf /var/cache/apk/* 10 | 11 | ENV release=v0.14.30 12 | RUN mkdir /syncthing \ 13 | && cd /syncthing \ 14 | && curl -s -L https://github.com/syncthing/syncthing/releases/download/${release}/syncthing-linux-amd64-${release}.tar.gz \ 15 | | tar -zx \ 16 | && mv syncthing-linux-amd64-${release}/syncthing . \ 17 | && rm -rf syncthing-linux-amd64-${release} 18 | 19 | USER syncthing 20 | ENV STNOUPGRADE=1 21 | ENTRYPOINT ["/syncthing/syncthing", "-home", "/var/syncthing/config", "-gui-address", "0.0.0.0:8384"] 22 | -------------------------------------------------------------------------------- /install/containers/docker-syncthing/Makefile: -------------------------------------------------------------------------------- 1 | CONTAINER_NAME=syncthing 2 | IMAGE_NAME=cpod/${CONTAINER_NAME} 3 | VOLUME=/data/Syncthing 4 | 5 | build: Dockerfile 6 | docker build -t $(IMAGE_NAME) . 7 | 8 | start: 9 | docker run -d -p 8384:8384 -p 22000:22000 \ 10 | -v ${VOLUME}/config:/var/syncthing/config \ 11 | -v ${VOLUME}/Sync:/var/syncthing/Sync \ 12 | --name ${CONTAINER_NAME} \ 13 | ${IMAGE_NAME} 14 | 15 | stop: 16 | docker stop $(CONTAINER_NAME) 17 | docker rm $(CONTAINER_NAME) 18 | 19 | clean: 20 | docker rmi $(IMAGE_NAME) 21 | docker images 22 | 23 | clean-volume: 24 | rm -fr $(VOLUME)/{*,.??*} 25 | 26 | -------------------------------------------------------------------------------- /install/containers/docker-syncthing/README.md: -------------------------------------------------------------------------------- 1 | # docker-syncthing 2 | 3 | 4 | -------------------------------------------------------------------------------- /install/etc/hosts: -------------------------------------------------------------------------------- 1 | # Begin /etc/hosts (network card version) 2 | 3 | ::1 localhost ipv6-localhost ipv6-loopback 4 | 127.0.0.1 localhost.localdomain 5 | 127.0.0.1 localhost 6 | # End /etc/hosts (network card version) 7 | 172.16.184.6 starships 8 | 62.23.45.214 vco 9 | 10.50.0.3 cpodedge mgmt-cpodrouter cpod-mgmt 10 | 10.50.0.6 cpodrouter-gateway-214 cpod-gateway-214 11 | 172.16.0.13 cpod-common #bdereims VMware1! 12 | 172.16.0.14 cpod-vr #ahugla VMware1! 13 | 172.16.0.21 cpod-cld #cdavin VMware1! 14 | 172.16.0.22 cpod-hja-dc1 #hjanasik VMware1! 15 | 172.16.0.31 cpod-nasser #nzitout MZVD7Dsfo4jbmzS! 16 | 172.16.0.15 cpod-gv #vmeoc Qo90epGwdxHnyw7! 17 | 172.16.0.29 cpod-prosegur #jhuerta IdNRbo0zoidxQyJ! 18 | 172.16.0.16 cpod-velocloud #adeleporte 265kA2278w2HycY! 19 | 172.16.0.20 cpod-mbe-dc1 #mohamedb zKizAVq7ZOT6SCk! 20 | 172.16.0.28 cpod-cld-t #cdavin tqGOyCFaRh6dBgr! 21 | 172.16.0.37 cpod-djaenv #djakubowicz 0hC7mO8eYqVfAM7! 22 | 172.16.0.38 cpod-vcn #adeleporte OCQ9RbjFe3dCWWD! 23 | 172.16.0.23 cpod-cde-dc1 #cdelbosc 6m631XordqTqqTs! 24 | 172.16.0.26 cpod-bbrundert01 #bbrundert01 zuYwbRkkg2H1a7k! 25 | 172.16.0.24 cpod-aca-dc1 #acaussignac SSL4uJzp9fpjqnC! 26 | 172.16.0.18 cpod-workshop #bdereims BAb75oLzJd1iAtj! 27 | 172.16.0.25 cpod-openshift #bdereims FcP3u4ircHgp5C2! 28 | 172.16.0.17 cpod-goodvibes #vmeoc kEfl9sgsDBnMISB! 29 | 172.16.0.27 cpod-jfc-new #jcouturier iTMygHMdrB6HTDO! 30 | 172.16.0.19 cpod-shwrfr #bdereims U69Bah8FQQOWvbu! 31 | -------------------------------------------------------------------------------- /install/etc/motd: -------------------------------------------------------------------------------- 1 | 2 | _____ _ _____ _ 3 | ___| _ |___ _| | __|_| |___ ___ 4 | | _| __| . | . | __| . | . | -_| 5 | |___|__| |___|___|_____|___|_ |___| 6 | @shwrfr |___| 7 | 8 | 9 | -------------------------------------------------------------------------------- /install/etc/ntp.conf: -------------------------------------------------------------------------------- 1 | tinker panic 0 2 | restrict default kod nomodify notrap nopeer noquery 3 | restrict 127.0.0.1 4 | restrict -6 ::1 5 | driftfile /var/lib/ntp/drift/ntp.drift 6 | server 0.europe.pool.ntp.org 7 | server 1.europe.pool.ntp.org 8 | server 2.europe.pool.ntp.org 9 | server 3.europe.pool.ntp.org 10 | -------------------------------------------------------------------------------- /install/etc/quagga/bgpd.conf: -------------------------------------------------------------------------------- 1 | ! 2 | ! Zebra configuration saved from vty 3 | ! 2018/12/20 18:45:37 4 | ! 5 | hostname bgpd 6 | password VMware1! 7 | enable password VMware1! 8 | log stdout 9 | ! 10 | router bgp 65100 11 | bgp router-id 172.16.100.50 12 | redistribute connected 13 | redistribute static 14 | ! 15 | address-family ipv6 16 | exit-address-family 17 | exit 18 | ! 19 | access-list all permit any 20 | ! 21 | line vty 22 | ! 23 | -------------------------------------------------------------------------------- /install/gen-motd-cpodbuild.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 4) 2 | _____ _ _____ _ _ _ 3 | ___| _ |___ _| | __ |_ _|_| |_| | 4 | | _| __| . | . | __ -| | | | | . | 5 | |___|__| |___|___|_____|___|_|_|___| 6 | 7 | $(tput setaf 2)@shwrfr$(tput sgr0) | $(tput setaf 1)az-demo$(tput sgr0) 8 | " 9 | -------------------------------------------------------------------------------- /install/gen-motd-cpodedge-rainbow-2.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 1) 2 | $(tput setaf 1) _____$(tput setaf 2) _$(tput setaf 3) _____ _$(tput setaf 4) 3 | $(tput setaf 1) ___| _ |$(tput setaf 2)___ _| $(tput setaf 3)| __|_| |$(tput setaf 4)___ ___ 4 | $(tput setaf 1)| _| __$(tput setaf 2)| . | . $(tput setaf 3)| __| . $(tput setaf 4)| . | -_| 5 | $(tput setaf 1)|___|__| $(tput setaf 2)|___|___$(tput setaf 3)|_____|___$(tput setaf 4)|_ |___| 6 | $(tput setaf 1) $(tput setaf 2) $(tput setaf 3) $(tput setaf 4)|___| 7 | $(tput setaf 2)@shwrfr$(tput sgr0) | $(tput setaf 1)az-demo$(tput sgr0) 8 | " 9 | -------------------------------------------------------------------------------- /install/gen-motd-cpodedge-rainbow.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 1) 2 | _____ _ _____ _ $(tput setaf 1) 3 | ___| _ |___ _| | __|_| |___ ___ $(tput setaf 2) 4 | | _| __| . | . | __| . | . | -_|$(tput setaf 6) 5 | |___|__| |___|___|_____|___|_ |___|$(tput setaf 6) 6 | |___| 7 | $(tput setaf 2)@shwrfr$(tput sgr0) | $(tput setaf 1)az-lab$(tput sgr0) 8 | " 9 | -------------------------------------------------------------------------------- /install/gen-motd-cpodedge.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 4) 2 | _____ _ _____ _ 3 | ___| _ |___ _| | __|_| |___ ___ 4 | | _| __| . | . | __| . | . | -_| 5 | |___|__| |___|___|_____|___|_ |___| 6 | |___| 7 | $(tput setaf 2)@shwrfr$(tput sgr0) | $(tput setaf 1)az-demo$(tput sgr0) 8 | " 9 | -------------------------------------------------------------------------------- /install/gen-motd-cpodfiler.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 4) 2 | _____ _ _____ _ _ 3 | ___| _ |___ _| | __|_| |___ ___ 4 | | _| __| . | . | __| | | -_| _| 5 | |___|__| |___|___|__| |_|_|___|_| 6 | 7 | $(tput sgr0)cpod-###NAME### 8 | " 9 | -------------------------------------------------------------------------------- /install/gen-motd-cpodrouter.sh: -------------------------------------------------------------------------------- 1 | echo "$(tput setaf 4) 2 | _____ _ _____ _ 3 | ___| _ |___ _| | __ |___ _ _| |_ ___ ___ 4 | | _| __| . | . | -| . | | | _| -_| _| 5 | |___|__| |___|___|__|__|___|___|_| |___|_| 6 | 7 | $(tput sgr0)cpod-###NAME### 8 | " 9 | -------------------------------------------------------------------------------- /install/html/50x.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error 5 | 12 | 13 | 14 |

An error occurred.

15 |

Sorry, the page you are looking for is currently unavailable.
16 | Please try again later.

17 |

If you are the system administrator of this resource then you should check 18 | the error log for details.

19 |

Faithfully yours, nginx.

20 | 21 | 22 | -------------------------------------------------------------------------------- /install/html/assets/css/ie9.css: -------------------------------------------------------------------------------- 1 | /* 2 | Dimension by HTML5 UP 3 | html5up.net | @ajlkn 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | /* BG */ 8 | 9 | #bg:before { 10 | background: rgba(19, 21, 25, 0.5); 11 | } 12 | 13 | /* Header */ 14 | 15 | #header .logo { 16 | margin: 0 auto; 17 | } 18 | 19 | #header .content { 20 | display: inline-block; 21 | } 22 | 23 | #header nav ul { 24 | display: inline-block; 25 | } 26 | 27 | #header nav ul li { 28 | display: inline-block; 29 | } 30 | 31 | /* Main */ 32 | 33 | #main article { 34 | margin: 0 auto; 35 | } -------------------------------------------------------------------------------- /install/html/assets/css/noscript.css: -------------------------------------------------------------------------------- 1 | /* 2 | Dimension by HTML5 UP 3 | html5up.net | @ajlkn 4 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | */ 6 | 7 | /* Main */ 8 | 9 | #main article { 10 | opacity: 1; 11 | margin: 4rem 0 0 0; 12 | } -------------------------------------------------------------------------------- /install/html/assets/css/skull.css: -------------------------------------------------------------------------------- 1 | .parent { 2 | position: relative; 3 | } 4 | .child { 5 | position: absolute; 6 | top: 50%; 7 | left: 50%; 8 | transform: translate(-50%, -50%); 9 | } 10 | -------------------------------------------------------------------------------- /install/html/assets/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/assets/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /install/html/assets/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/assets/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /install/html/assets/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/assets/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /install/html/assets/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/assets/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /install/html/assets/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/assets/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /install/html/assets/sass/base/_page.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Dimension by HTML5 UP 3 | /// html5up.net | @ajlkn 4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | /// 6 | 7 | /* Basic */ 8 | 9 | // MSIE: Required for IEMobile. 10 | @-ms-viewport { 11 | width: device-width; 12 | } 13 | 14 | // Ensures page width is always >=320px. 15 | @include breakpoint(xsmall) { 16 | html, body { 17 | min-width: 320px; 18 | } 19 | } 20 | 21 | body { 22 | background: _palette(bg); 23 | 24 | // Prevents animation/transition "flicker" on page load. 25 | // Automatically added/removed by js/main.js. 26 | &.is-loading, 27 | &.is-switching { 28 | *, *:before, *:after { 29 | @include vendor('animation', 'none !important'); 30 | @include vendor('transition', 'none !important'); 31 | @include vendor('transition-delay', 'none !important'); 32 | } 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /install/html/assets/sass/components/_box.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Dimension by HTML5 UP 3 | /// html5up.net | @ajlkn 4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | /// 6 | 7 | /* Box */ 8 | 9 | .box { 10 | border-radius: _size(border-radius); 11 | border: solid _size(border-width) _palette(border); 12 | margin-bottom: _size(element-margin); 13 | padding: 1.5em; 14 | 15 | > :last-child, 16 | > :last-child > :last-child, 17 | > :last-child > :last-child > :last-child { 18 | margin-bottom: 0; 19 | } 20 | 21 | &.alt { 22 | border: 0; 23 | border-radius: 0; 24 | padding: 0; 25 | } 26 | } -------------------------------------------------------------------------------- /install/html/assets/sass/components/_icon.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Dimension by HTML5 UP 3 | /// html5up.net | @ajlkn 4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | /// 6 | 7 | /* Icon */ 8 | 9 | .icon { 10 | @include icon; 11 | border-bottom: none; 12 | position: relative; 13 | 14 | > .label { 15 | display: none; 16 | } 17 | } -------------------------------------------------------------------------------- /install/html/assets/sass/ie9.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/vars'; 2 | @import 'libs/functions'; 3 | @import 'libs/mixins'; 4 | @import 'libs/skel'; 5 | 6 | /* 7 | Dimension by HTML5 UP 8 | html5up.net | @ajlkn 9 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 10 | */ 11 | 12 | /* BG */ 13 | 14 | #bg { 15 | &:before { 16 | background: _palette(bg-overlay); 17 | } 18 | } 19 | 20 | /* Header */ 21 | 22 | #header { 23 | .logo { 24 | margin: 0 auto; 25 | } 26 | 27 | .content { 28 | display: inline-block; 29 | } 30 | 31 | nav { 32 | ul { 33 | display: inline-block; 34 | 35 | li { 36 | display: inline-block; 37 | } 38 | } 39 | } 40 | } 41 | 42 | /* Main */ 43 | 44 | #main { 45 | article { 46 | margin: 0 auto; 47 | } 48 | } -------------------------------------------------------------------------------- /install/html/assets/sass/layout/_footer.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Dimension by HTML5 UP 3 | /// html5up.net | @ajlkn 4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | /// 6 | 7 | /* Footer */ 8 | 9 | #footer { 10 | @include vendor('transition', ( 11 | 'transform #{_duration(article)} ease-in-out', 12 | 'filter #{_duration(article)} ease-in-out', 13 | 'opacity #{_duration(article)} ease-in-out', 14 | )); 15 | width: 100%; 16 | max-width: 100%; 17 | margin-top: 2rem; 18 | text-align: center; 19 | 20 | .copyright { 21 | letter-spacing: _font(letter-spacing); 22 | font-size: 0.6rem; 23 | opacity: 0.75; 24 | margin-bottom: 0; 25 | text-transform: uppercase; 26 | } 27 | 28 | body.is-article-visible & { 29 | @include vendor('transform', 'scale(0.95)'); 30 | @include vendor('filter', 'blur(0.1rem)'); 31 | opacity: 0; 32 | } 33 | 34 | body.is-loading & { 35 | opacity: 0; 36 | } 37 | } -------------------------------------------------------------------------------- /install/html/assets/sass/layout/_wrapper.scss: -------------------------------------------------------------------------------- 1 | /// 2 | /// Dimension by HTML5 UP 3 | /// html5up.net | @ajlkn 4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 5 | /// 6 | 7 | /* Wrapper */ 8 | 9 | #wrapper { 10 | @include vendor('display', 'flex'); 11 | @include vendor('flex-direction', 'column'); 12 | @include vendor('align-items', 'center'); 13 | @include vendor('justify-content', 'space-between'); 14 | position: relative; 15 | min-height: 100vh; 16 | width: 100%; 17 | padding: 4rem 2rem; 18 | z-index: 3; 19 | 20 | &:before { 21 | content: ''; 22 | display: block; 23 | } 24 | 25 | @include breakpoint(xlarge) { 26 | padding: 3rem 2rem; 27 | } 28 | 29 | @include breakpoint(small) { 30 | padding: 2rem 1rem; 31 | } 32 | 33 | @include breakpoint(xsmall) { 34 | padding: 1rem; 35 | } 36 | } -------------------------------------------------------------------------------- /install/html/assets/sass/libs/_functions.scss: -------------------------------------------------------------------------------- 1 | /// Gets a duration value. 2 | /// @param {string} $keys Key(s). 3 | /// @return {string} Value. 4 | @function _duration($keys...) { 5 | @return val($duration, $keys...); 6 | } 7 | 8 | /// Gets a font value. 9 | /// @param {string} $keys Key(s). 10 | /// @return {string} Value. 11 | @function _font($keys...) { 12 | @return val($font, $keys...); 13 | } 14 | 15 | /// Gets a misc value. 16 | /// @param {string} $keys Key(s). 17 | /// @return {string} Value. 18 | @function _misc($keys...) { 19 | @return val($misc, $keys...); 20 | } 21 | 22 | /// Gets a palette value. 23 | /// @param {string} $keys Key(s). 24 | /// @return {string} Value. 25 | @function _palette($keys...) { 26 | @return val($palette, $keys...); 27 | } 28 | 29 | /// Gets a size value. 30 | /// @param {string} $keys Key(s). 31 | /// @return {string} Value. 32 | @function _size($keys...) { 33 | @return val($size, $keys...); 34 | } -------------------------------------------------------------------------------- /install/html/assets/sass/libs/_vars.scss: -------------------------------------------------------------------------------- 1 | // Misc. 2 | $misc: ( 3 | z-index-base: 10000 4 | ); 5 | 6 | // Duration. 7 | $duration: ( 8 | transition: 0.2s, 9 | bg: 2.5s, 10 | intro: 0.75s, 11 | article: 0.325s 12 | ); 13 | 14 | // Size. 15 | $size: ( 16 | border-radius: 4px, 17 | border-width: 1px, 18 | element-height: 2.75rem, 19 | element-margin: 2rem 20 | ); 21 | 22 | // Font. 23 | $font: ( 24 | family: ('Source Sans Pro', sans-serif), 25 | family-fixed: ('Courier New', monospace), 26 | weight: 300, 27 | weight-bold: 600, 28 | letter-spacing: 0.2rem, 29 | letter-spacing-heading: 0.5rem 30 | ); 31 | 32 | // Palette. 33 | $palette: ( 34 | bg: #1b1f22, 35 | bg-alt: #000000, 36 | bg-overlay: rgba(19,21,25,0.5), 37 | fg: #ffffff, 38 | fg-bold: #ffffff, 39 | fg-light: rgba(255,255,255,0.5), 40 | border: #ffffff, 41 | border-bg: rgba(255,255,255,0.075), 42 | border-bg-alt: rgba(255,255,255,0.175) 43 | ); -------------------------------------------------------------------------------- /install/html/assets/sass/main.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/vars'; 2 | @import 'libs/functions'; 3 | @import 'libs/mixins'; 4 | @import 'libs/skel'; 5 | @import 'font-awesome.min.css'; 6 | @import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:300italic,600italic,300,600'); 7 | 8 | /* 9 | Dimension by HTML5 UP 10 | html5up.net | @ajlkn 11 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 12 | */ 13 | 14 | @include skel-breakpoints(( 15 | xlarge: '(max-width: 1680px)', 16 | large: '(max-width: 1280px)', 17 | medium: '(max-width: 980px)', 18 | small: '(max-width: 736px)', 19 | xsmall: '(max-width: 480px)', 20 | xxsmall: '(max-width: 360px)' 21 | )); 22 | 23 | @include skel-layout(( 24 | reset: 'full', 25 | boxModel: 'border' 26 | )); 27 | 28 | // Base. 29 | 30 | @import 'base/page'; 31 | @import 'base/typography'; 32 | 33 | // Component. 34 | 35 | @import 'components/form'; 36 | @import 'components/box'; 37 | @import 'components/icon'; 38 | @import 'components/image'; 39 | @import 'components/list'; 40 | @import 'components/table'; 41 | @import 'components/button'; 42 | 43 | // Layout. 44 | 45 | @import 'layout/bg'; 46 | @import 'layout/wrapper'; 47 | @import 'layout/header'; 48 | @import 'layout/main'; 49 | @import 'layout/footer'; -------------------------------------------------------------------------------- /install/html/assets/sass/noscript.scss: -------------------------------------------------------------------------------- 1 | @import 'libs/vars'; 2 | @import 'libs/functions'; 3 | @import 'libs/mixins'; 4 | @import 'libs/skel'; 5 | 6 | /* 7 | Dimension by HTML5 UP 8 | html5up.net | @ajlkn 9 | Free for personal and commercial use under the CCA 3.0 license (html5up.net/license) 10 | */ 11 | 12 | /* Main */ 13 | 14 | #main { 15 | article { 16 | opacity: 1; 17 | margin: (_size(element-margin) * 2) 0 0 0; 18 | } 19 | } -------------------------------------------------------------------------------- /install/html/images/R630comp_front.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/R630comp_front.jpg -------------------------------------------------------------------------------- /install/html/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/bg.jpg -------------------------------------------------------------------------------- /install/html/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/logo.png -------------------------------------------------------------------------------- /install/html/images/overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/overlay.png -------------------------------------------------------------------------------- /install/html/images/pic01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/pic01.jpg -------------------------------------------------------------------------------- /install/html/images/pic02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/pic02.jpg -------------------------------------------------------------------------------- /install/html/images/pic03.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/pic03.jpg -------------------------------------------------------------------------------- /install/html/images/shwrfr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/shwrfr.png -------------------------------------------------------------------------------- /install/html/images/skull-tr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/skull-tr.png -------------------------------------------------------------------------------- /install/html/images/skull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/skull.png -------------------------------------------------------------------------------- /install/html/images/vmware.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/html/images/vmware.png -------------------------------------------------------------------------------- /install/html/index.html-old: -------------------------------------------------------------------------------- 1 | 2 | 3 | shwrfr 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /install/html/skull.css: -------------------------------------------------------------------------------- 1 | vertical-align: middle; 2 | display: inline-block; 3 | -------------------------------------------------------------------------------- /install/html/skull.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | shwrfr 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /install/html/slack/add_filer.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /install/html/slack/add_filer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tmux new -d "cd /root/cPodFactory ; ./extra/add_filer.sh $1 $2" 4 | -------------------------------------------------------------------------------- /install/html/slack/archive/mise_en_prodV2.php: -------------------------------------------------------------------------------- 1 | > ./log'); 15 | exec('echo '.$token.' - '.$text.' >> ./log'); 16 | 17 | exec('echo launch '.$text.' >> ./log'); 18 | $reply = exec('./trigger_pipeline_saasV2.sh '); 19 | echo $reply; 20 | 21 | /*foreach ($_POST as $name => $value) { 22 | $text=$name . ' : ' . $value . ', ' . $text; 23 | } 24 | echo $text; 25 | */ 26 | -------------------------------------------------------------------------------- /install/html/slack/check_cpod.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | NAME=$( echo $1 | tr '[:upper:]' '[:lower:]' ) 4 | if [ "x${NAME}" != "x" ]; then 5 | RESULT=$( cat /etc/hosts | awk '{print $2"#"}' | grep "cpod-${NAME}#" | wc -l ) 6 | RESULT=$( expr ${RESULT} ) 7 | if [ ${RESULT} -gt 0 ]; then 8 | echo "No Ok!" 9 | exit 1 10 | fi 11 | fi 12 | 13 | echo "Ok!" 14 | exit 0 15 | -------------------------------------------------------------------------------- /install/html/slack/cpodctl.php: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /install/html/slack/create_cpod.php: -------------------------------------------------------------------------------- 1 | 4) { 28 | $msg = ":thumbsdown: You are not allowed to deploy more than 4 ESXi."; 29 | die($msg); 30 | } 31 | exec("nohup ./create_cpod.sh ".strtoupper($CPOD[0])." ".$CPOD[1]." ".$user_name." > nohup.out & > /dev/null"); 32 | } else { 33 | echo ":zombie: This name already exists."; 34 | } 35 | } else { 36 | echo ":wow: Nothing to do! Parameters are missing."; 37 | } 38 | 39 | ?> 40 | -------------------------------------------------------------------------------- /install/html/slack/create_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /root/cPodFactory 4 | ./cpodctl create $1 $2 $3 5 | 6 | #ENV="Name:${1} #ESX:${2} Owner:${3}" 7 | -------------------------------------------------------------------------------- /install/html/slack/delete_cpod.php: -------------------------------------------------------------------------------- 1 | nohup.out & > /dev/null"); 22 | } 23 | } else { 24 | $reply = exec("./list_cpod.sh ".$user_name); 25 | echo "You're owner of: ".$reply; 26 | } 27 | 28 | ?> 29 | -------------------------------------------------------------------------------- /install/html/slack/delete_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /root/cPodFactory 4 | ./delete_cpod.sh $1 $2 5 | 6 | #ENV="Name:${1} #ESX:${2} Owner:${3}" 7 | -------------------------------------------------------------------------------- /install/html/slack/deploy_vcsa.php: -------------------------------------------------------------------------------- 1 | 23 | -------------------------------------------------------------------------------- /install/html/slack/deploy_vcsa.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tmux new -d "cd /root/cPodFactory ; bash -x ./extra/deploy_vcsa.sh $1 $2" 4 | -------------------------------------------------------------------------------- /install/html/slack/licensing_cpod.php: -------------------------------------------------------------------------------- 1 | nohup.out & > /dev/null"); 14 | echo "Licensing is applied on *${CPOD[0]}*."; 15 | } else { 16 | echo ":zombie: cPod *".strtoupper($CPOD[0])."* does not exist."; 17 | } 18 | } else { 19 | echo ":wow: Nothing to do! Name of cPod is missing."; 20 | } 21 | -------------------------------------------------------------------------------- /install/html/slack/licensing_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | tmux -c "cd /data/cPod/shwrfr ; ./licensing_cpod.sh $1" 4 | -------------------------------------------------------------------------------- /install/html/slack/list_cpod.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /install/html/slack/list_cpod.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | HEADER="https://cpodrouter." 4 | 5 | if [ "x$1" = "x" ]; then 6 | 7 | LIST="Direct link to cPod:" 8 | 9 | for CPOD in $( cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)"("$3")"}' ); do 10 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 11 | FOOTER=$( grep "/cpod-${FQDN}." /etc/dnsmasq.conf | head -1 | sed -e "s#^.*cpod-${FQDN}##" -e "s#/.*##" -e "s/ //g" ) 12 | FQDN="${HEADER}cpod-${FQDN}${FOOTER}" 13 | CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 14 | LIST="${LIST} <${FQDN}|$CPOD>" 15 | done 16 | 17 | else 18 | 19 | for CPOD in $( cat /etc/hosts | grep $1 | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)}' ); do 20 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 21 | FQDN="https://vcsa.cpod-${FQDN}.shwrfr.mooo.com" 22 | #CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 23 | LIST="${LIST} <${FQDN}|$CPOD>" 24 | done 25 | 26 | fi 27 | 28 | echo "${LIST}" 29 | -------------------------------------------------------------------------------- /install/html/slack/list_cpod.sh-vcsa: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | HEADER="https://vcsa." 4 | 5 | if [ "x$1" = "x" ]; then 6 | 7 | LIST="Direct link to VCSA for:" 8 | 9 | for CPOD in $( cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)"("$3")"}' ); do 10 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 11 | FOOTER=$( grep "/cpod-${FQDN}." /etc/dnsmasq.conf | head -1 | sed -e "s#^.*cpod-${FQDN}##" -e "s#/.*##" -e "s/ //g" ) 12 | FQDN="${HEADER}cpod-${FQDN}${FOOTER}" 13 | CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 14 | LIST="${LIST} <${FQDN}|$CPOD>" 15 | done 16 | 17 | else 18 | 19 | for CPOD in $( cat /etc/hosts | grep $1 | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)}' ); do 20 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 21 | FQDN="https://vcsa.cpod-${FQDN}.shwrfr.mooo.com" 22 | #CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 23 | LIST="${LIST} <${FQDN}|$CPOD>" 24 | done 25 | 26 | fi 27 | 28 | echo "${LIST}" 29 | -------------------------------------------------------------------------------- /install/html/slack/mise_en_prod.php: -------------------------------------------------------------------------------- 1 | > ./log'); 15 | exec('echo '.$token.' - '.$text.' >> ./log'); 16 | 17 | exec('echo launch '.$text.' >> ./log'); 18 | $reply = exec('./trigger_pipeline_saasV2.sh '); 19 | echo $reply; 20 | 21 | /*foreach ($_POST as $name => $value) { 22 | $text=$name . ' : ' . $value . ', ' . $text; 23 | } 24 | echo $text; 25 | */ 26 | -------------------------------------------------------------------------------- /install/html/slack/mise_en_prod.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | if [ "${1}" == "" ]; then 4 | echo "Rien à mettre en production!" 5 | echo "### ${1}" >> ./log 6 | exit 0 7 | fi 8 | 9 | echo "Lancement de la mise en production de ${1} ${2} ${3}" 10 | ./trigger_pipeline_saas.sh ${1} 11 | -------------------------------------------------------------------------------- /install/html/slack/nohup.out: -------------------------------------------------------------------------------- 1 | === Starting to deploy a new cPod called 'cPod-DASHING-NEWT'. 2 | ok172.16.2.12 3 | The cPod IP address is '172.16.2.17' in transit network. 4 | The subnet of the cPod is '172.20.7.0/24'. 5 | Logicial Switch 'cpod-dashing-newt' has been sucessfully created in 'TransportZone'. 6 | Modifying 'vxw-dvs-24-virtualwire-169-sid-5006-cpod-dashing-newt' with MacLearn and ForgedTransmits. 7 | Modifying '/etc/dnsmasq.conf' and '/etc/hosts'. 8 | Adding cPodRouter as BGP peer 172.16.2.17 with ASN 65217 9 | Building Configuration... 10 | Configuration saved to /etc/quagga/zebra.conf 11 | Configuration saved to /etc/quagga/bgpd.conf 12 | [OK] 13 | Creating vApp 'cPod-DASHING-NEWT' with 1 ESXi. 14 | -------------------------------------------------------------------------------- /install/html/slack/password_cpod.php: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /install/html/slack/password_cpod.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | if [ "$1" == "bdereims" ]; then 4 | LIST=$( cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print "*"toupper($2)"* > "$4" "}' | tr -d '\n' ) 5 | else 6 | LIST=$( cat /etc/hosts | grep $1 | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print "*"toupper($2)"* > "$4" "}' | tr -d '\n' ) 7 | fi 8 | 9 | echo "cPod Password: ${LIST}" 10 | exit 0 11 | 12 | for CPOD in $( cat /etc/hosts | grep $1 | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print "*"toupper($2)"* : "$4}' ); do 13 | LIST="#${LIST}# #${CPOD}#" 14 | done 15 | 16 | echo "cPod Password: ${LIST}" 17 | -------------------------------------------------------------------------------- /install/html/slack/start_cpod.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /install/html/slack/start_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /root/cPodFactory/compute 4 | ./start_cpod.sh $1 5 | 6 | #ENV="cPod Name:${1}" 7 | 8 | -------------------------------------------------------------------------------- /install/html/slack/status_shwrfr.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /install/html/slack/status_shwrfr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /root/cPodFactory 4 | ./status_shwrfr.sh 5 | 6 | echo "Visit for further details." 7 | 8 | #ENV="Name:${1} #ESX:${2} Owner:${3}" 9 | -------------------------------------------------------------------------------- /install/html/slack/test.php: -------------------------------------------------------------------------------- 1 | 4) { 32 | $msg = ":thumbsdown: You are not allowed to deploy more than 4 ESXi."; 33 | die($msg); 34 | } 35 | echo "This test failed successfully" 36 | } else { 37 | echo ":zombie: This name already exists."; 38 | } 39 | } else { 40 | echo ":wow: Nothing to do! Parameters are missing."; 41 | } 42 | 43 | ?> 44 | -------------------------------------------------------------------------------- /install/html/slack/token.php-example: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /install/html/slack/trigger_pipeline_saasV2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #vmeoc 3 | 4 | export api_token=88e1999e-b9d1-4dcb-ac55-6d30076e61db 5 | export bearer=`curl -X POST 'https://api.mgmt.cloud.vmware.com/iaas/login' -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{ 'refreshToken': '$api_token' }' | jq -r '.token'` 6 | export PipelineID=778edaf8cba12675589e3a5de871a 7 | 8 | curl -X POST 'https://api.mgmt.cloud.vmware.com/pipeline/api/pipelines/'$PipelineID'/executions' -H 'Content-Type: application/json' -H 'Authorization: Bearer '$bearer'' -d '{}' 9 | -------------------------------------------------------------------------------- /install/html/slack/wiki_cpod.php: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /install/html/slack/wiki_cpod.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | HEADER="https://vcsa." 4 | FOOTER=".shwrfr.mooo.com" 5 | 6 | if [ "x$1" = "x" ]; then 7 | 8 | LIST="Direct link to the wiki:" 9 | 10 | for CPOD in $( cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)"("$3")"}' ); do 11 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 12 | FQDN="http://photon-machine.cpod-common.az-demo.shwrfr.com:8082/dokuwiki/doku.php?id=cpods:${FQDN}" 13 | CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 14 | LIST="${LIST} <${FQDN}|$CPOD>" 15 | done 16 | 17 | else 18 | 19 | for CPOD in $( cat /etc/hosts | grep $1 | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2)}' ); do 20 | FQDN=$( echo ${CPOD} | cut -f1 -d"(" | tr [:upper:] [:lower:] ) 21 | FQDN="http://photon-machine.cpod-common.az-demo.shwrfr.com:8082/dokuwiki/doku.php?id=cpods:${FQDN}" 22 | #CPOD=$( echo ${CPOD} | sed "s/()//" | sed "s/(/ (/" ) 23 | LIST="${LIST} <${FQDN}|$CPOD>" 24 | done 25 | 26 | fi 27 | 28 | echo "${LIST}" 29 | -------------------------------------------------------------------------------- /install/motd: -------------------------------------------------------------------------------- 1 |  2 | _____ _ _____ _ 3 | ___| _ |___ _| | __ |___ _ _| |_ ___ ___ 4 | | _| __| . | . | -| . | | | _| -_| _| 5 | |___|__| |___|___|__|__|___|___|_| |___|_| 6 | 7 | (Bcpod-###NAME### 8 | 9 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodEdge/iptables.cpod-isolation: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # eth4 is the cpod-transit-diode, a one-way connectivity from entire Lab to Public cPod 5 | iptables -I FORWARD 1 -i eth4 -j DROP 6 | iptables -I FORWARD 1 -i eth4 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 7 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodEdge/rc-local.service: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: LGPL-2.1+ 2 | # 3 | # This file is part of systemd. 4 | # 5 | # systemd is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation; either version 2.1 of the License, or 8 | # (at your option) any later version. 9 | 10 | # This unit gets pulled automatically into multi-user.target by 11 | # systemd-rc-local-generator if /etc/rc.d/rc.local is executable. 12 | [Unit] 13 | Description=/etc/rc.d/rc.local Compatibility 14 | Documentation=man:systemd-rc-local-generator(8) 15 | ConditionFileIsExecutable=/etc/rc.d/rc.local 16 | After=network.target 17 | 18 | [Service] 19 | Type=forking 20 | ExecStartPre=/bin/sleep 30 21 | ExecStart=/etc/rc.d/rc.local start 22 | TimeoutSec=0 23 | RemainAfterExit=yes 24 | GuessMainPID=no 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodEdge/rc.local: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | iptables -L -n -v --line-numbers > mylog 5 | echo "###" >> mylog 6 | 7 | /etc/systemd/scripts/iptables.cpod-isolation 8 | 9 | echo "###" >> mylog 10 | iptables -L -n -v --line-numbers >> mylog 11 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodRouter/haproxy.cfg: -------------------------------------------------------------------------------- 1 | global 2 | tune.ssl.default-dh-param 2048 3 | 4 | defaults 5 | #timeout connect 5000 6 | #timeout client 50000 7 | #timeout server 50000 8 | timeout connect 1h 9 | timeout client 10m 10 | timeout server 10m 11 | 12 | frontend ssl 13 | mode tcp 14 | bind 0.0.0.0:443 15 | tcp-request inspect-delay 5s 16 | tcp-request content accept if HTTP 17 | use_backend ssh if { payload(0,7) -m bin 5353482d322e30 } 18 | use_backend main-ssl if { req.ssl_hello_type 1 } 19 | default_backend rdp 20 | 21 | frontend main 22 | bind 127.0.0.1:443 ssl crt /etc/haproxy/cert.pem accept-proxy 23 | mode http 24 | option forwardfor 25 | default_backend webserver 26 | 27 | #frontend http 28 | # bind 0.0.0.0:80 29 | # reqadd X-Forwarded-Proto:\ http 30 | # default_backend webserver 31 | 32 | backend main-ssl 33 | mode tcp 34 | server main-ssl 127.0.0.1:443 send-proxy 35 | 36 | backend rdp 37 | mode tcp 38 | timeout server 2h 39 | server rift 172.19.8.9:3389 40 | 41 | backend ssh 42 | mode tcp 43 | timeout server 2h 44 | server ssh-localhost 172.19.8.1:22 45 | 46 | backend webserver 47 | mode http 48 | option forwardfor 49 | redirect scheme https code 301 if !{ ssl_fc } 50 | server webserver-localhost 172.19.8.1:4443 51 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodRouter/snippets/ssl-params.conf: -------------------------------------------------------------------------------- 1 | # SSL ciphers from https://mozilla.github.io/server-side-tls/ssl-config-generator/ 2 | ssl_protocols TLSv1.2; 3 | ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; 4 | ssl_prefer_server_ciphers on; 5 | ssl_session_cache shared:SSL:50m; 6 | ssl_session_tickets off; 7 | resolver 172.19.5.1; # change this to your dns resolver's IP if necessary 8 | ssl_stapling on; 9 | ssl_stapling_verify on; 10 | 11 | # uncomment this for HSTS 12 | #add_header Strict-Transport-Security 'max-age=63072000'; 13 | 14 | add_header X-Frame-Options SAMEORIGIN; 15 | add_header X-Content-Type-Options nosniff; 16 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodRouter/ssl/shwrfr.com/shwrfr.com.conf: -------------------------------------------------------------------------------- 1 | Le_Domain='shwrfr.com' 2 | Le_Alt='*.shwrfr.com' 3 | Le_Webroot='dns' 4 | Le_PreHook='' 5 | Le_PostHook='' 6 | Le_RenewHook='' 7 | Le_Keylength='' 8 | Le_OrderFinalize='https://acme-v02.api.letsencrypt.org/acme/finalize/56264531/427802984' 9 | 10 | Le_LinkOrder='https://acme-v02.api.letsencrypt.org/acme/order/56264531/427802984' 11 | Le_LinkCert='https://acme-v02.api.letsencrypt.org/acme/cert/04e6dec5fd7c0a90987bb000b4cb5431ca14' 12 | Le_CertCreateTime='1556775229' 13 | Le_CertCreateTimeStr='Thu May 2 05:33:49 UTC 2019' 14 | Le_NextRenewTimeStr='Mon Jul 1 05:33:49 UTC 2019' 15 | Le_NextRenewTime='1561872829' 16 | -------------------------------------------------------------------------------- /install/multiplex-reverseproxy-isolation/cPodRouter/ssl/shwrfr.com/shwrfr.com.csr.conf: -------------------------------------------------------------------------------- 1 | [ req_distinguished_name ] 2 | [ req ] 3 | distinguished_name = req_distinguished_name 4 | req_extensions = v3_req 5 | [ v3_req ] 6 | 7 | keyUsage = nonRepudiation, digitalSignature, keyEncipherment 8 | subjectAltName=DNS:shwrfr.com,DNS:*.shwrfr.com -------------------------------------------------------------------------------- /install/network/eth0-static.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=eth0 3 | 4 | [Network] 5 | Address=10.50.0.3/24 6 | #Gateway=10.1.0.2 7 | 8 | [DHCP] 9 | UseDNS=false 10 | -------------------------------------------------------------------------------- /install/network/eth1-static.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=eth1 3 | 4 | [Network] 5 | Address=172.16.100.50/22 6 | Gateway=172.16.100.254 7 | 8 | [DHCP] 9 | UseDNS=false 10 | -------------------------------------------------------------------------------- /install/network/eth2-static.network: -------------------------------------------------------------------------------- 1 | [Match] 2 | Name=eth0 3 | 4 | [Network] 5 | Address=172.16.0.6/24 6 | 7 | [DHCP] 8 | UseDNS=false 9 | -------------------------------------------------------------------------------- /install/photon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/photon.png -------------------------------------------------------------------------------- /install/pxe/dnsmasq.conf: -------------------------------------------------------------------------------- 1 | listen-address=127.0.0.1,172.20.12.1,172.16.2.22 2 | interface=lo,eth0,eth1 3 | bind-interfaces 4 | expand-hosts 5 | bogus-priv 6 | #dns-forward-max=150 7 | cache-size=1000 8 | domain=cpod-caisson.az-lab.shwrfr.com 9 | local=/cpod-caisson.az-lab.shwrfr.com/ 10 | server=/az-lab.shwrfr.com/172.16.2.1 11 | server=172.16.2.1 12 | no-dhcp-interface=lo,eth1 13 | dhcp-range=172.20.12.200,172.20.12.254,255.255.255.0,12h 14 | dhcp-option=option:router,172.20.12.1 15 | dhcp-option=option:ntp-server,172.20.12.1 16 | dhcp-option=option:domain-search,cpod-caisson.az-lab.shwrfr.com 17 | enable-tftp 18 | tftp-root=/data/tftpboot 19 | dhcp-boot=mboot.efi 20 | enable-tftp 21 | -------------------------------------------------------------------------------- /install/sbin/bgpd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/bgpd -------------------------------------------------------------------------------- /install/sbin/govc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/govc -------------------------------------------------------------------------------- /install/sbin/iftop: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/iftop -------------------------------------------------------------------------------- /install/sbin/libreadline.so.6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/libreadline.so.6 -------------------------------------------------------------------------------- /install/sbin/libzebra.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/libzebra.so -------------------------------------------------------------------------------- /install/sbin/pwgen: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/pwgen -------------------------------------------------------------------------------- /install/sbin/vtysh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/vtysh -------------------------------------------------------------------------------- /install/sbin/zebra: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bdereims/cPodFactory/e3d41ac11f01eaedb715437d495454a20b61f3e6/install/sbin/zebra -------------------------------------------------------------------------------- /install/systemd/backup.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Backup Script 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/data/Backup/backup.sh 7 | User=root 8 | -------------------------------------------------------------------------------- /install/systemd/backup.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Everyday Backup 3 | 4 | [Timer] 5 | OnCalendar=*-*-* 00:00:00 6 | 7 | [Install] 8 | WantedBy=timers.target 9 | -------------------------------------------------------------------------------- /install/systemd/bgpd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Quagga BGP daemon 3 | Wants=zebra.service 4 | After=zebra.service 5 | 6 | [Service] 7 | Type=forking 8 | ExecStart=/usr/sbin/bgpd -d -f /etc/quagga/bgpd.conf -i /etc/quagga/bgpd.pid 9 | Restart=always 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | 14 | #[Timer] 15 | #OnBootSec=20sec 16 | -------------------------------------------------------------------------------- /install/systemd/docker-container@haproxy.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Container %I 3 | Requires=docker.service 4 | After=docker.service 5 | 6 | [Service] 7 | Restart=always 8 | ExecStart=/usr/bin/docker start -a %i 9 | ExecStop=/usr/bin/docker stop -t 2 %i 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /install/systemd/docker-container@openvpn-udp.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Container %I 3 | Requires=docker.service 4 | After=docker.service 5 | 6 | [Service] 7 | Restart=always 8 | ExecStart=/usr/bin/docker start -a %i 9 | ExecStop=/usr/bin/docker stop -t 2 %i 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /install/systemd/docker-container@openvpn.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Container %I 3 | Requires=docker.service 4 | After=docker.service 5 | 6 | [Service] 7 | Restart=always 8 | ExecStart=/usr/bin/docker start -a %i 9 | ExecStop=/usr/bin/docker stop -t 2 %i 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /install/systemd/docker-container@syncthing.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Container %I 3 | Requires=docker.service 4 | After=docker.service 5 | 6 | [Service] 7 | Restart=always 8 | ExecStart=/usr/bin/docker start -a %i 9 | ExecStop=/usr/bin/docker stop -t 2 %i 10 | 11 | [Install] 12 | WantedBy=default.target 13 | -------------------------------------------------------------------------------- /install/systemd/iptables.cpod-isolation: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # eth4 is the cpod-transit-diode, a one-way connectivity to Public cPod 5 | iptables -I FORWARD 1 -o eth4 -j DROP 6 | iptables -I FORWARD 1 -i eth4 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 7 | 8 | #iptables -I FORWARD 1 -i eth2 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 9 | #iptables -I FORWARD 1 -i eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 10 | 11 | ### SAND BOX Isolation ### 12 | #iptables -I INPUT 2 -i eth2 -s 172.16.1.15 -j DROP 13 | #iptables -I INPUT 2 -i eth2 -s 172.19.5.0/24 -j DROP 14 | #iptables -I FORWARD 2 -i eth2 -s 172.16.1.15 -j DROP 15 | #iptables -I FORWARD 2 -i eth2 -s 172.19.5.0/24 -j DROP 16 | 17 | ### CHARMING-WARM Isolation ### 18 | #iptables -I INPUT 2 -i eth2 -s 172.16.1.18 -j DROP 19 | #iptables -I INPUT 2 -i eth2 -s 172.19.8.0/24 -j DROP 20 | #iptables -I FORWARD 2 -i eth2 -s 172.16.1.18 -j DROP 21 | #iptables -I FORWARD 2 -i eth2 -s 172.19.8.0/24 -j DROP 22 | -------------------------------------------------------------------------------- /install/systemd/rc-local.service: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: LGPL-2.1+ 2 | # 3 | # This file is part of systemd. 4 | # 5 | # systemd is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU Lesser General Public License as published by 7 | # the Free Software Foundation; either version 2.1 of the License, or 8 | # (at your option) any later version. 9 | 10 | # This unit gets pulled automatically into multi-user.target by 11 | # systemd-rc-local-generator if /etc/rc.d/rc.local is executable. 12 | [Unit] 13 | Description=/etc/rc.d/rc.local Compatibility 14 | Documentation=man:systemd-rc-local-generator(8) 15 | ConditionFileIsExecutable=/etc/rc.d/rc.local 16 | After=network.target 17 | 18 | [Service] 19 | Type=forking 20 | ExecStartPre=/bin/sleep 30 21 | ExecStart=/etc/rc.d/rc.local start 22 | TimeoutSec=0 23 | RemainAfterExit=yes 24 | GuessMainPID=no 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | -------------------------------------------------------------------------------- /install/systemd/zebra.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Quagga Zebra daemon 3 | Before=bgpd.service 4 | 5 | [Service] 6 | Type=forking 7 | ExecStart=/usr/sbin/zebra -d -f /etc/quagga/zebra.conf -i /etc/quagga/zebra.pid 8 | Restart=always 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | 13 | #[Timer] 14 | #OnBootSec=20sec 15 | -------------------------------------------------------------------------------- /list_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | DNSMASQ=/etc/dnsmasq.conf 7 | HOSTS=/etc/hosts 8 | 9 | main() { 10 | echo "=== List of cPods" 11 | #cat /etc/hosts | cut -f2 | grep "cpod-" | sed "s/cpod-//" | tr [:lower:] [:upper:] 12 | cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2),"("$3")"}' 13 | } 14 | 15 | main $1 16 | -------------------------------------------------------------------------------- /list_cpod_bgp_peering.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | DNSMASQ=/etc/dnsmasq.conf 7 | HOSTS=/etc/hosts 8 | 9 | main() { 10 | echo "=== List of cPods." 11 | cat /etc/hosts | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print $1," ",toupper($2),"("$3")"}' | sort 12 | } 13 | 14 | main $1 15 | -------------------------------------------------------------------------------- /network/add_bgp_neighbour.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | DATA=/tmp/$$-data 9 | 10 | ./network/get_bgp.sh ${1} > ${DATA} 11 | 12 | PEER=$( echo "###IP###172.16.0.2172.16.0.165001650016018060" | sed "s/###IP###/${2}/" ) 13 | 14 | cat ${DATA} | tail -n -1 | sed "s/<\/bgpNeighbours>.*$//" > ${DATA}_HEADER 15 | cat ${DATA} | tail -n -1 | sed "0,/bgpNeighbour/ s/<\/bgpNeighbours>/#TRUC#/" | sed "s/^.*#TRUC#//" > ${DATA}_FOOTER 16 | 17 | cat ${DATA}_HEADER > ${DATA}_NEW 18 | echo ${PEER} >> ${DATA}_NEW 19 | cat ${DATA}_FOOTER >> ${DATA}_NEW 20 | 21 | ./network/put_bgp.sh ${1} ${DATA}_NEW 22 | 23 | rm /tmp/${$}* 24 | 25 | -------------------------------------------------------------------------------- /network/add_bgp_peer_vtysh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | CMD="vtysh -e \"configure terminal\" -e \"router bgp ${ASN}\" -e \"neighbor ${1} remote-as ${2}\" -e \"exit\" -e \"exit\" -e \"write\"" 9 | 10 | eval ${CMD} 11 | -------------------------------------------------------------------------------- /network/create_logicalswitch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | 9 | TZ_ID=$( ${NETWORK_DIR}/id_transportzone.sh ${1} ) 10 | [ "${TZ_ID}" == "" ] && echo "${1} doesn't exist!" && exit 1 11 | 12 | #NEW_LOGICALSWITCH="${2}Logical Switch via REST APIHYBRID_MODEtrue" 13 | NEW_LOGICALSWITCH="${2}Logical Switch via REST APIHYBRID_MODEtrue" 14 | 15 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -H "Content-Type:text/xml;charset=UTF-8" -X POST --data "${NEW_LOGICALSWITCH}" https://${NSX}/api/2.0/vdn/scopes/${TZ_ID}/virtualwires 2>&1 > /dev/null 16 | 17 | LS_PROPS=$( ${NETWORK_DIR}/props_logicialswitch.sh $1 $2 ) 18 | 19 | [ "${LS_PROPS}" != "" ] && echo "Logicial Switch '${2}' has been sucessfully created in '${1}'." && exit 0 20 | 21 | echo "Logical Switch '${2}' does not seem to be created." && exit 1 22 | -------------------------------------------------------------------------------- /network/delete_bgp_neighbour.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | DATA=/tmp/data 9 | 10 | ./network/get_bgp.sh ${1} > ${DATA} 11 | 12 | cat ${DATA} | tail -n -1 | sed "s/${2}.*$//" > ${DATA}_HEADER 13 | cat ${DATA} | tail -n -1 | sed "s/${2}<\/ipAddress>172.16.0.2<\/protocolAddress>172.16.0.1<\/forwardingAddress>65001<\/remoteAS>65001<\/remoteASNumber>60<\/weight>180<\/holdDownTimer>60<\/keepAliveTimer><\/bgpNeighbour>/#TRUC#/" | sed "s/^.*#TRUC#//" > ${DATA}_FOOTER 14 | 15 | cat ${DATA}_HEADER > ${DATA}_NEW 16 | echo ${PEER} >> ${DATA}_NEW 17 | cat ${DATA}_FOOTER >> ${DATA}_NEW 18 | 19 | ./network/put_bgp.sh ${1} ${DATA}_NEW 20 | -------------------------------------------------------------------------------- /network/delete_bgp_peer_vtysh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | CMD="vtysh -e \"configure terminal\" -e \"router bgp ${ASN}\" -e \"no neighbor ${1} remote-as ${2}\" -e \"exit\" -e \"exit\" -e \"write\"" 9 | 10 | eval ${CMD} 11 | -------------------------------------------------------------------------------- /network/delete_ip_pool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | #curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/scope/globalroot-0 | jq '. | .["allScopes"] | .[0] | {name: .name, id: .id}' 7 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X DELETE -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/${1}/ipaddresses/${2} | jq 8 | -------------------------------------------------------------------------------- /network/delete_logicalswitch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | TZ_ID=$( ${NETWORK_DIR}/id_transportzone.sh ${1} ) 9 | [ "${TZ_ID}" == "" ] && echo "'${1}' doesn't exist!" && exit 1 10 | 11 | VIRTUALWIRE_ID=$( ${NETWORK_DIR}/props_logicialswitch.sh $1 $2 | jq '.objectId' | sed 's/"//g' ) 12 | [ "${VIRTUALWIRE_ID}" == "" ] && echo "Logical Switch '$2' doesn't exist in '$1'." && exit 1 13 | 14 | echo "Deleting '${VIRTUALWIRE_ID}' on '${1}'." 15 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -H "Content-Type:text/xml;charset=UTF-8" -X DELETE https://${NSX}/api/2.0/vdn/virtualwires/${VIRTUALWIRE_ID} 2>&1 > /dev/null 16 | -------------------------------------------------------------------------------- /network/delete_pool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | #curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/scope/globalroot-0 | jq '. | .["allScopes"] | .[0] | {name: .name, id: .id}' 7 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X DELETE -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/${1} 8 | -------------------------------------------------------------------------------- /network/get_bgp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/xml" https://${NSX}/api/4.0/edges/${1}/routing/config/bgp 9 | -------------------------------------------------------------------------------- /network/get_routing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/xml" https://${NSX}/api/4.0/edges/${1}/routing/config 9 | -------------------------------------------------------------------------------- /network/id_transportzone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/vdn/scopes | jq '. | .["allScopes"] | .[0] | select(.name == "'${1}'") | .id' | sed 's/"//g' 9 | -------------------------------------------------------------------------------- /network/list_dvs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/vdn/switches | jq ' . | .["switches"] | .[] | .["switchObj"] | .objectId' | sed 's/"//g' 7 | #curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/xml" https://${NSX}/api/2.0/vdn/switches/dvs-17 8 | -------------------------------------------------------------------------------- /network/list_ip_pool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | #curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/scope/globalroot-0 | jq '. | .["allScopes"] | .[0] | {name: .name, id: .id}' 7 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/${1}/ipaddresses | jq 8 | -------------------------------------------------------------------------------- /network/list_logicalswitch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | TZ_ID=$( ${NETWORK_DIR}/id_transportzone.sh ${1} ) 9 | [ "${TZ_ID}" == "" ] && echo "${1} doesn't exist!" && exit 1 10 | 11 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" "https://${NSX}/api/2.0/vdn/scopes/${TZ_ID}/virtualwires?pagesize=254&startindex=0" | jq '. | .["dataPage"] | .["data"] | .[] | {name: .name, vdnID: .vdnId, portgroup: .backing[].backingValue}' 12 | -------------------------------------------------------------------------------- /network/list_pool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | #curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/scope/globalroot-0 | jq '. | .["allScopes"] | .[0] | {name: .name, id: .id}' 7 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/services/ipam/pools/scope/globalroot-0 | jq 8 | -------------------------------------------------------------------------------- /network/list_transportzone.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" https://${NSX}/api/2.0/vdn/scopes | jq '. | .["allScopes"] | .[0] | {name: .name, id: .id}' 7 | -------------------------------------------------------------------------------- /network/props_dvs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/xml" https://${NSX}/api/2.0/vdn/switches/${1} 9 | -------------------------------------------------------------------------------- /network/props_logicialswitch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | TZ_ID=$( ${NETWORK_DIR}/id_transportzone.sh ${1} ) 9 | [ "${TZ_ID}" == "" ] && echo "${1} doesn't exist!" && exit 1 10 | 11 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X GET -H "Accept: application/json" "https://${NSX}/api/2.0/vdn/scopes/${TZ_ID}/virtualwires?pagesize=254&startindex=0" | jq '. | .["dataPage"] | .["data"] | .[] | select(.name == "'${2}'")' 12 | -------------------------------------------------------------------------------- /network/put_bgp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X PUT -H "Content-Type:text/xml;charset=UTF-8" -d @${2} https://${NSX}/api/4.0/edges/${1}/routing/config/bgp 9 | -------------------------------------------------------------------------------- /network/put_routing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -X PUT -H "Content-Type:text/xml;charset=UTF-8" -d @${2} https://${NSX}/api/4.0/edges/${1}/routing/config 9 | -------------------------------------------------------------------------------- /network/update_dvs_mtu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" -o "$2" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | 9 | UPDATE=$( ./network/props_dvs.sh ${1} | tail -1 | sed "s#.*#${2}#" ) 10 | VDS_ID=$( echo $UPDATE | sed -e "s#.*##" -e "s#^.*>##" ) 11 | 12 | curl -s -k -u ${NSX_ADMIN}:${NSX_PASSWD} -H "Content-Type:text/xml;charset=UTF-8" -X PUT --data "${UPDATE}" https://${NSX}/api/2.0/vdn/switches 13 | -------------------------------------------------------------------------------- /password_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 " && exit 1 7 | 8 | if [ "${2}" == "" ]; then 9 | OWNER="admin" 10 | else 11 | OWNER="${1}" 12 | fi 13 | 14 | HOSTS=/etc/hosts 15 | 16 | main() { 17 | echo "=== List of cPod Password" 18 | cat /etc/hosts | grep ${1} | sed "s/#//" | awk '$2 ~ /cpod-/ {gsub(/cpod-/,""); print toupper($2),": "$4}' 19 | } 20 | 21 | main $1 22 | -------------------------------------------------------------------------------- /prep_cpod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | . ./env 5 | 6 | [ "$1" == "" ] && echo "usage: $0 <#_of_esx>" && exit 1 7 | 8 | HOSTS=/etc/hosts 9 | GEN_PASSWD=$( ./extra/passwd_for_cpod.sh ${1} ) 10 | 11 | main() { 12 | echo "=== Preparing cPod '${1}' with ${2} ESX." 13 | 14 | SHELL_SCRIPT=prep_and_add_esx.sh 15 | 16 | SCRIPT_DIR=/tmp/scripts 17 | SCRIPT=/tmp/scripts/$$ 18 | 19 | mkdir -p ${SCRIPT_DIR} 20 | cp ${COMPUTE_DIR}/${SHELL_SCRIPT} ${SCRIPT} 21 | sed -i -e "s/###ROOT_PASSWD###/${ROOT_PASSWD}/" -e "s/###GEN_PASSWD###/${GEN_PASSWD}/" \ 22 | -e "s/###ISO_BANK_SERVER###/${ISO_BANK_SERVER}/" \ 23 | -e "s!###ISO_BANK_DIR###!${ISO_BANK_DIR}!" \ 24 | -e "s/###NUM_ESX###/${2}/" \ 25 | ${SCRIPT} 26 | 27 | CPOD_NAME="cpod-$1" 28 | CPOD_NAME_LOWER=$( echo ${CPOD_NAME} | tr '[:upper:]' '[:lower:]' ) 29 | 30 | ./compute/wait_ip.sh ${CPOD_NAME_LOWER} 31 | sleep 20 32 | 33 | THEIP=$( cat /etc/hosts | awk '{print $1,$2}' | sed -n "/${CPOD_NAME_LOWER}$/p" | awk '{print $1}' ) 34 | 35 | #sshpass -p ${ROOT_PASSWD} scp ~/.ssh/id_rsa.pub root@${CPOD_NAME_LOWER}:/root/.ssh/authorized_keys 36 | #scp -o StrictHostKeyChecking=no ${SCRIPT} root@${CPOD_NAME_LOWER}:./${SHELL_SCRIPT} 37 | #ssh -o StrictHostKeyChecking=no root@${CPOD_NAME_LOWER} "./${SHELL_SCRIPT}" 38 | 39 | sshpass -p ${ROOT_PASSWD} scp ~/.ssh/id_rsa.pub root@${THEIP}:/root/.ssh/authorized_keys 2>&1 > /dev/null 40 | scp -o StrictHostKeyChecking=no ${SCRIPT} root@${THEIP}:./${SHELL_SCRIPT} 2>&1 > /dev/null 41 | ssh -o StrictHostKeyChecking=no root@${THEIP} "./${SHELL_SCRIPT}" 2>&1 > /dev/null 42 | 43 | rm ${SCRIPT} 44 | } 45 | 46 | main $1 $2 47 | -------------------------------------------------------------------------------- /save-env-intel: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | # this file is not synced in git 5 | . ./env.passwd 6 | 7 | SLACK=NO 8 | LEASE=NO 9 | 10 | ROOT_DOMAIN="az-demo.shwrfr.com" 11 | 12 | # Transit LS for cPodRouter connectivity 13 | TRANSIT=172.19 14 | ASN=65100 15 | 16 | TRANSIT_NET="172.16" 17 | DNS="${TRANSIT_NET}.1.1" 18 | 19 | CLUSTER="INTEL" 20 | HEADER="cPod" 21 | 22 | NETWORK_DIR=network 23 | COMPUTE_DIR=compute 24 | EXTRA_DIR=extra 25 | 26 | NSX=10.1.0.152 27 | NSX_ADMIN="admin" 28 | NSX_TRANSPORTZONE="TransportZone" 29 | 30 | ISO_BANK_SERVER="10.1.0.51" 31 | ISO_BANK_DIR="/VNXeDatastore/ISO-Bank" 32 | 33 | VCENTER=10.1.0.29 34 | VCENTER_ADMIN="cpod@intel.lab" 35 | VCENTER_DATACENTER="INTEL-LAB" 36 | VCENTER_CLUSTER="INTEL Cluster" 37 | TEMPLATE_VM="template-cPodRouter" 38 | #TEMPLATE_ESX="template-ESX67U3" 39 | TEMPLATE_ESX="template-ESX70beta" 40 | TEMPLATE_FILER="template-cPodFiler" 41 | DATASTORE=${DATASTORE:="INTEL-VSAN"} 42 | -------------------------------------------------------------------------------- /slack_motd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #jacobssimon@vmware.com 3 | 4 | . ./env 5 | . ./govc_env 6 | 7 | 8 | main() { 9 | MOTD="\`\`\` 10 | ┌─ ╔╦╗╔═╗╦ ╦╔═╗╔═╗╔═╗ ╔╦╗ ╔╦╗╔═╗╦ ╦ ─┐ \n 11 | │ ║║║╣ ╚╗╔╝║ ║╠═╝╚═╗ ║║─── ║║╠═╣╚╦╝ │ \n 12 | └─ ═╩╝╚═╝ ╚╝ ╚═╝╩ ╚═╝ ═╩╝ ═╩╝╩ ╩ ╩ ─┘ \n 13 | ┌─ ┌┬┐┬ ┬┌─┐ ╔╦╗╦╔╦╗╔═╗ ┌─┐┬─┐┌─┐ ┬┌─┐┌─┐┌┬┐─┐ \n 14 | │ │ ├─┤├┤ ║ ║ ║ ║ ║ ├─┘├┬┘│ │ │├┤ │ │ │ \n 15 | └─ ┴ ┴ ┴└─┘ ╩ ╩ ╩ ╚═╝ ┴ ┴└─└─┘└┘└─┘└─┘ ┴ ─┘ \n 16 | ┌─ ┌┐ ┬ ┬ ╦ ╦╔╦╗┬ ┬┌─┐┬─┐┌─┐ ─┐ \n 17 | │ ├┴┐└┬┘ ╚╗╔╝║║║│││├─┤├┬┘├┤ │ \n 18 | └─ └─┘ ┴ ╚╝ ╩ ╩└┴┘┴ ┴┴└─└─┘ ─┘ 19 | \`\`\`" 20 | 21 | echo "${MOTD}" 22 | ./extra/post_slack.sh "$MOTD" 23 | } 24 | 25 | main $1 26 | -------------------------------------------------------------------------------- /slack_motd.txt: -------------------------------------------------------------------------------- 1 | ``` 2 | ___ _____ ____ _____ _____ __ __ ___ 3 | | _| | __ \ / __ \ | __ \ | __ \ /\\ \ / / |_ | 4 | | | | | | | _____ _| | | |_ __ ___ | | | |______| | | | / \\ \_/ / | | 5 | | | | | | |/ _ \ \ / / | | | '_ \/ __| | | | |______| | | |/ /\ \\ / | | 6 | | | | |__| | __/\ V /| |__| | |_) \__ \ | |__| | | |__| / ____ \| | | | 7 | | |_ |_____/ \___| \_/ \____/| .__/|___/ |_____/ |_____/_/ \_\_| _| | 8 | |___| | | |___| 9 | ___ _ __ ___|_|__ ___ 10 | | _| | | \ \ / / \/ | |_ | 11 | | | | |__ _ _ \ \ / /| \ / |_ ____ _ _ __ ___ | | 12 | | | | '_ \| | | | \ \/ / | |\/| \ \ /\ / / _` | '__/ _ \ | | 13 | | | | |_) | |_| | \ / | | | |\ V V / (_| | | | __/ | | 14 | | |_ |_.__/ \__, | \/ |_| |_| \_/\_/ \__,_|_| \___| _| | 15 | |___| __/ | |___| 16 | |___/ ``` 17 | -------------------------------------------------------------------------------- /smoke_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #bdereims@vmware.com 3 | 4 | N=5 5 | HEADER="SMOKETEST" 6 | 7 | for i in $( seq -f "%03g" 1 ${N} ); 8 | do 9 | NUM_ESX=$( echo $RANDOM % 6 + 3 | bc ) 10 | 11 | case "$1" in 12 | create) 13 | echo ">>> Create #${i} with ${NUM_ESX} ESXi" 14 | ./create_cpod.sh ${HEADER}${i} ${NUM_ESX} smoketester & 15 | ;; 16 | 17 | delete) 18 | echo ">>> Delete #${i}" 19 | ./delete_cpod.sh ${HEADER}${i} smoketester & 20 | ;; 21 | 22 | *) 23 | echo $"Usage: $0 {create|delete}" 24 | exit 1 25 | 26 | esac 27 | done 28 | -------------------------------------------------------------------------------- /status_shwrfr.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ./govc_env 4 | 5 | date > /tmp/$$ 6 | echo " " >> /tmp/$$ 7 | govc datacenter.info >> /tmp/$$ 8 | echo " " >> /tmp/$$ 9 | govc metric.ls host/* | grep cpu. | xargs govc metric.sample host/* >> /tmp/$$ 10 | echo " " >> /tmp/$$ 11 | govc metric.ls host/* | grep mem. | xargs govc metric.sample host/* >> /tmp/$$ 12 | echo " " >> /tmp/$$ 13 | govc datastore.info >> /tmp/$$ 14 | 15 | #awk 'BEGIN{print ""} {print "";for(i=1;i<=NF;i++)print "";print ""} END{print "
" $i"
"}' /tmp/$$ > /etc/nginx/html/status.html 16 | #awk 'BEGIN{print ""} {print "";for(i=1;i<=NF;i++)print "";print ""} END{print "
" $i"
"}' /tmp/$$ > /etc/nginx/html/status.html 17 | cat /tmp/$$ | sed 's/$/
/' > /etc/nginx/html/status.html 18 | 19 | rm /tmp/$$ 20 | 21 | chown nobody /etc/nginx/html/status.html 22 | 23 | -------------------------------------------------------------------------------- /update_network.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #exit 0 4 | 5 | . ./env 6 | 7 | CPOD=$( cat zz | grep "172.16" | grep "cpod-" | awk '{print $1}' ) 8 | 9 | for THEIP in $CPOD; 10 | do 11 | CPODASN=$( echo ${THEIP} | cut -f4 -d"." ) 12 | CPODASN=$( expr ${ASN} + ${CPODASN} ) 13 | echo ${THEIP} ${ASN} ${CPODASN} 14 | 15 | scp update_network_cpodrouter.sh ${THEIP}:. 16 | ssh ${THEIP} "bash update_network_cpodrouter.sh ${CPODASN}" 17 | 18 | ./network/delete_bgp_peer_vtysh.sh ${THEIP} 65201 19 | ./network/add_bgp_peer_vtysh.sh ${THEIP} ${CPODASN} 20 | 21 | done 22 | -------------------------------------------------------------------------------- /update_network_cpodrouter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i "s/router bgp 65201/router bgp ${1}/" /etc/quagga/bgpd.conf 4 | systemctl restart bgpd 5 | --------------------------------------------------------------------------------