admin管理员组

文章数量:1023782

I am looking to make an Amazon AMI using Packer. I have a YAML file which I can copy across successfully.

"provisioners": [
 {
    "type": "file",
    "source": "flights.yaml",
    "destination": "/tmp/flights.yaml"
 }
]

However, there is one value in the file I would like to pass in as a variable.

 packer build \
    -var "ami_name=flights-november" \
    -var "source_ami=ami-XXX" \
    -var "seed_data={thisiswhatIwantinthefile}"
    ./ami.json

Is there a clean way to do this? Other than something like a search and replace?

connecting: false
 MCT: {thisiswhatIwanttoreplace}
 terminal-1:
   - jetblue
   - american
   - untied
 terminal-2:
   - airfrance
   - lufthansa

I am looking to make an Amazon AMI using Packer. I have a YAML file which I can copy across successfully.

"provisioners": [
 {
    "type": "file",
    "source": "flights.yaml",
    "destination": "/tmp/flights.yaml"
 }
]

However, there is one value in the file I would like to pass in as a variable.

 packer build \
    -var "ami_name=flights-november" \
    -var "source_ami=ami-XXX" \
    -var "seed_data={thisiswhatIwantinthefile}"
    ./ami.json

Is there a clean way to do this? Other than something like a search and replace?

connecting: false
 MCT: {thisiswhatIwanttoreplace}
 terminal-1:
   - jetblue
   - american
   - untied
 terminal-2:
   - airfrance
   - lufthansa

本文标签: PackerCopy amp Update file in one goStack Overflow