limnh / journey

Notes and learnings along the way of becoming an engineer
0 stars 1 forks source link

2019-03-05 #14

Closed limnh closed 5 years ago

limnh commented 5 years ago

Issues/Questions:

  1. I need to get my Packer code into Github to continue testing against it.

  2. how do we get a server spun up in packet via CircleCI? outlined in #12

  3. once a server is spun up, how do we tear it down after the run is finished?

    • cannot see server spin up in packet, do we need to add another step to allow it to provision before we tear it down?
    • can we timebox terraform destroy?
  4. how do we get the IP address out of the TFE artifacts?

  5. how do we get packer spun up within the packet node?

Solutions:

  1. added a new repo within my personal org, preparing to add packer docs

  2. 12 has been solved by adding the following (also includes the terraform destroy task mentioned below):

  <<: *default_config
  steps:
    - *restore_repo
    - *set_terraform_environment
    - *terraform_init
    - attach_workspace:
        at: *working_directory
    - run:
        name: terraform apply
        command: |
          source $BASH_ENV
          pwd
          ls -al
          cd packet/builder && terraform apply --auto-approve terraform.plan
        name: terraform destroy
        command: |
            cd packet/builder && terraform destroy --force
        when: always
  1. chatted with alvin and dani about best practices. terraform destroy was added to the terraform apply job to ensure that the created resource is always destroyed at the end of a run (when: always)

    • job successfully runs but states Destroy complete! Resources: 0 destroyed. at the end? cannot see any evidence of a server being created by this job
    • removed the destroy task, can see the server in packet now. requires more tweaking. however, the server is running 18.04 so I've got that going for me
  2. still don't know

  3. alvin pointed me to go-discovery which has a similar set-up. working on adapting some principles there to get packer up