Skip to content

Instantly share code, notes, and snippets.

Avatar

Josiah Haswell josiahhaswell

  • https://sunshower.io
  • Ft. Collins
View GitHub Profile
View configuration.auto.tfvars
cluster_nodes = {
etcd_nodes = [
{
name = "etcd-1"
ip = "192.168.1.5"
},
{
name = "etcd-2"
ip = "192.168.1.6"
View configuration.auto.tfvars
dns_server = {
// replace with your zone-name (configured above)
zone = "sunshower.cloud." // note the trailing period here--it's mandatory
// replace with your DNS server's IP
server = "192.168.1.2"
}
// this generates the DNS configuration for `kubernetes.sunshower.cloud`
api_dns = "kubernetes"
api_domain = "sunshower.cloud"
@josiahhaswell
josiahhaswell / main.tf
Created Feb 22, 2021
main.tf DNS module definition
View main.tf
/**
Create DNS entries for virtual machines
*/
module "dns_configuration" {
for_each = var.cluster_nodes
source = "./dns"
dns_server = var.dns_server
hosts = each.value
api_dns = var.api_server
api_domain = var.domain
@josiahhaswell
josiahhaswell / dns-config.tf
Created Feb 22, 2021
main.tf DNS provider configuration
View dns-config.tf
provider "dns" {
update {
server = var.dns_server.server
}
}
@josiahhaswell
josiahhaswell / main.tf
Created Feb 22, 2021
main.tf/terraform config
View main.tf
terraform {
required_version = ">=0.14"
required_providers {
dns = {
source = "hashicorp/dns"
version = "3.0.1"
}
}
}
@josiahhaswell
josiahhaswell / variables.tf
Created Feb 22, 2021
structural variables
View variables.tf
variable "A" {
type = object({
name = string
ip = string
})
}
variable "B" {
type = object({
name = string
View main.tf
terraform {
required_providers {
dns = {
source = "hashicorp/dns"
}
}
}
/**
View deploy-artifacts.yml
- uses: actions/upload-artifact@v2
with:
name: zephyr-main
path: zephyr-main/build/distributions/*.zip
- name: get commit message
run: echo ::set-env name=commitmsg::$(git log --format=%B -n 1 ${{ github.event.after }})
- name: Perform Release
id: create_release
View finish.yml
- name: Commit Version Changes
run: |
git config --local user.email "build@sunshower.io"
git config --local user.name "build"
git commit -am "Final Release [tag: final, version: ${{steps.finalVersion.outputs.result}}]"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
git tag -a v${{ steps.finalVersion.outputs.result }} -m "Releasing ${{ steps.finalVersion.outputs.result }}"
git push origin v${{ steps.finalVersion.outputs.result }}
View deploy.yml
- name: Deploy Bills-Of-Materials
run: >-
mvn install deploy -f bom
--settings bom/settings/settings.xml
-Dsunshower-repo.username=${{secrets.MAVEN_REPOSITORY_USERNAME}}
-Dsunshower-repo.password=${{secrets.MAVEN_REPOSITORY_PASSWORD}} -e