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

[centos-*] Improve DRYness, correctness, and speed of CentOS templates. #396

Merged
merged 2 commits into from
Jul 9, 2015

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented Jul 9, 2015

The following improvements are made in this commit:

  • Ensure that all related provisioner shell scripts are written using
    more conservative bourne code idioms
  • Call all provisioner scripts with sh -eux which will (e) exit
    immediately if a command exits with a non-zero exit status, (u) treats
    unset variables as an error, and (x) outputs the command and its
    expanded arguments or associated word list
  • Use the template user variable to replace repetition of "centos-*"
    style strings throughout
  • Support a HOME_DIR environment variable for provisioner scripts to
    use
  • Remove now-unused user variable arch
  • Extract the iso_checksum and iso_checksum_type values into user
    variables and reference them in the templates
  • Construct the iso_url value from the mirror, mirror_directory,
    and iso_name user variables
  • Add a ks_path user variable and use it throughout the templates
  • Add an iso_name user variable and use it throughout the templates
  • Use the http_proxy, https_proxy, and no_proxy environment
    variables if set on the workstation and make them available to the
    provisioner shell scripts to speed up package installations, etc.

fnichol added 2 commits July 9, 2015 14:18
The following improvements are made in this commit:

* Ensure that all related provisioner shell scripts are written using
  more conservative bourne code idioms
* Call all provisioner scripts with `sh -eux` which will (e) exit
  immediately if a command exits with a non-zero exit status, (u) treats
  unset variables as an error, and (x) outputs the command and its
  expanded arguments or associated word list
* Use the `template` user variable to replace repetition of `"centos-*"`
  style strings throughout
* Support a `HOME_DIR` environment variable for provisioner scripts to
  use
* Remove now-unused user variable `arch`
* Extract the `iso_checksum` and `iso_checksum_type` values into user
  variables and reference them in the templates
* Construct the `iso_url` value from the `mirror`, `mirror_directory`,
  and `iso_name` user variables
* Add a `ks_path` user variable and use it throughout the templates
* Add an `iso_name` user variable and use it throughout the templates
* Use the `http_proxy`, `https_proxy`, and `no_proxy` environment
  variables if set on the workstation and make them available to the
  provisioner shell scripts to speed up package installations, etc.
@fnichol fnichol self-assigned this Jul 9, 2015
@fnichol
Copy link
Contributor Author

fnichol commented Jul 9, 2015

\cc @cheeseplus

@cheeseplus
Copy link
Contributor

👍

cheeseplus pushed a commit that referenced this pull request Jul 9, 2015
[centos-*] Improve DRYness, correctness, and speed of CentOS templates.
@cheeseplus cheeseplus merged commit d73e6e4 into master Jul 9, 2015
@fnichol fnichol removed their assignment Jul 10, 2015
@legal90
Copy link
Contributor

legal90 commented Aug 14, 2015

@fnichol Could you please explain why have you replaced all box names with this one?

"box_basename": "__unset_box_basename__",

Now we always have to specify box name explicitly while running packer.

@cheeseplus cheeseplus deleted the refactor-centos-templates branch October 7, 2015 17:08
@tas50 tas50 added Type: Enhancement Adds new functionality. and removed Improvement labels Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants