You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: centos7/README.md
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,38 @@ The Packer template in this directory creates a CentOS 7 AMD64 image for use wit
15
15
*[MAAS](https://maas.io) 2.3+
16
16
*[Curtin](https://launchpad.net/curtin) 18.1-59+
17
17
18
-
## Customizing the Image
18
+
## Customizing the Image with Kickstart
19
19
20
-
The deployment image may be customized by modifying http/centos7.ks. See the [CentOS kickstart documentation](https://docs.centos.org/en-US/centos/install-guide/Kickstart2/) for more information.
20
+
The deployment image may be customized by modifying http/centos7.ks.pkrtpl.hcl. See the [CentOS kickstart documentation](https://docs.centos.org/en-US/centos/install-guide/Kickstart2/) for more information.
21
+
22
+
## Customizing the Image with Ansible (Optional)
23
+
24
+
Using Ansible as a provisioner in Packer, alongside modifications to the kickstart file, significantly simplifies the image-building process.
25
+
Writing complex configurations directly in the kickstart file, especially within the `%post` section, often leads to issues with escaping sequences and readability.
26
+
Inline scripts require careful handling of shell syntax, escape characters, and quotations, which can become cumbersome and error-prone for intricate configurations.
27
+
Ansible abstracts these complexities, allowing you to define configurations in a more readable and manageable YAML format.
28
+
This approach not only enhances maintainability but also reduces the risk of errors that can occur due to improper escaping or syntax issues in shell scripts.
29
+
Additionally, using Ansible as a provisioner allows for the maintenance of a single code base for provisioning across multiple operating systems.
30
+
This cross-platform capability simplifies management, reduces duplication of effort,
31
+
and ensures consistency in deployments, regardless of the operating system being provisioned.
32
+
33
+
To run Ansible provisioner following kickstart installation, perform the follwoing steps:
34
+
35
+
1. Make sure ansible is installed on the machine running packer
36
+
2. Add your ansible code to `ansible/playbook.yml`
0 commit comments