version: '3'

vars:
  HOST: testhost

tasks:

  fcct_image: docker pull quay.io/coreos/fcct:release

  fcct: docker run -i --rm quay.io/coreos/fcct:release --pretty --strict < {{.HOST}}.fcc > {{.HOST}}.ign

  fcct1:
    cmds:
      - fcct --pretty --strict -o {{.HOST}}.ign {{.HOST}}.fcc


  echo:
    silent: true
    cmds:
      - echo curl -LO http://192.168.54.20:48083/ignition/{{.HOST}}.ign
      - echo sudo coreos-installer install /dev/sda --ignition {{.HOST}}.ign

  gen:
    cmds:
      - task: fcct
        vars: { HOST: "{{.HOST}}" }
      - task: echo
        vars: { HOST: "{{.HOST}}" }

  butane: docker run -i --rm quay.io/coreos/butane:release --pretty --strict < {{.HOST}}.bu > {{.HOST}}.ign