Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor NOT to make directory templates #76

Open
syyang-in-cloud opened this issue Sep 24, 2020 · 3 comments
Open

Refactor NOT to make directory templates #76

syyang-in-cloud opened this issue Sep 24, 2020 · 3 comments

Comments

@syyang-in-cloud
Copy link
Member

syyang-in-cloud commented Sep 24, 2020

What's the issue?

  • Currently, it's necessary to template the whole directory to build a custom image. There should be better way to templating only the difference.
  • user-data.sh or/and
  • ansible

Definition of Done

  • Refactor the repo.
  • update README.md
@syyang-in-cloud
Copy link
Member Author

syyang-in-cloud commented Sep 24, 2020

Initial thought:

  1. Make base as template
  2. create sub directory per TYPE, each sub directory has user-data.sh and playbook.yml
  3. pass the TYPE as a variable to the script and playbook path

@syyang-in-cloud
Copy link
Member Author

syyang-in-cloud commented Sep 24, 2020

Quang's comment:

Why not have different user-data.sh files based on type .sh then pass TYPE variable into
packer.json:

"scripts": [
     "shell/{{TYPE}}.sh"
]

You can even use variables.json to store customizable variables.

@syyang-in-cloud
Copy link
Member Author

Quang's suggestion seems reasonable ... we will take the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant