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

[ENHANCEMENT] Use ansible provisioner for Linux configuration and packages #54

Closed
1 task done
tenthirtyam opened this issue Sep 25, 2021 · 6 comments · Fixed by #76, #75 or #109
Closed
1 task done

[ENHANCEMENT] Use ansible provisioner for Linux configuration and packages #54

tenthirtyam opened this issue Sep 25, 2021 · 6 comments · Fixed by #76, #75 or #109
Assignees
Labels

Comments

@tenthirtyam
Copy link
Collaborator

tenthirtyam commented Sep 25, 2021

Code of Conduct

  • I have read and agree to the project's Code of Conduct.

Description

Use ansible provisioner for Linux configuration and packages.

Use Case(s)

Cleaner management of configuration and packages for Linux machine images

Potential Configuration

References

No response

@sestegra
Copy link
Contributor

sestegra commented Sep 26, 2021

First, I suggest to divide playbook by OS family.

- name: Linux
  hosts: localhost
  gather_facts: yes
  become: yes
  tasks:
    - include_tasks: playbook-redhat.yml
      when: ansible_os_family == 'RedHat'

    - include_tasks: playbook-debian.yml
      when: ansible_os_family == 'Debian'

Then, I suggest to do the same for Windows with WinRM access.

@tenthirtyam tenthirtyam added sev/low Low priority/high High Priority size/l Large labels Sep 26, 2021
@tenthirtyam
Copy link
Collaborator Author

cc @gcblack.

This was linked to pull requests Sep 30, 2021
@tenthirtyam tenthirtyam added priority/medium Priority Medium and removed priority/high High Priority labels Oct 1, 2021
tenthirtyam pushed a commit that referenced this issue Oct 3, 2021
- Uses vendor / distributor `.iso` file name and checksum.
- Adds/updates build variables to include `iso_path`, `iso_file`, `iso_checksum_type`, and `iso_checksum_value`.
- Updates code style for the variables passed to a templatefile.
- Replaces the term "redhat-variant" with "redhat-derivative".
- Adds Ansible to Ubuntu 20.04 and 18.06 #54
@tenthirtyam
Copy link
Collaborator Author

Need to modify RHEL to use RHSM during kickstart to install Ansible. All other Linux distributions now have Ansible installed during kickstart.

tenthirtyam pushed a commit that referenced this issue Oct 4, 2021
- Moves RSHM registration to the kickstart
- Moves installation of the EPEL repository to the kickstart
- Updates provisioner script to check RHSM (via refresh) before installing additional packages.

Related Issue: #54
tenthirtyam pushed a commit that referenced this issue Oct 4, 2021
Look who's back... RHEL 7 and CentOS 7.
- Adds the builds and includes Ansible (#54) in each kickstart.
- Renames the scripts for RHEL/RHEL derivatives based on major version.
- Updates `build.sh`.
- Updates `README.md`.
@tenthirtyam
Copy link
Collaborator Author

All Linux distributions now have Ansible installed during the kickstart.

Proceeding to refactor script contents to ansible_local where possible.

Ryan

tenthirtyam added a commit to gcblack/packer-vsphere that referenced this issue Oct 6, 2021
Initial introduction of Ansible use:
- Adds `ansible-local` provisioner to Ubuntu builds.
- Adde an initial playbook to remove steps from the `shell` build's provisioner scripts.
- Removes steps in the `ubuntu*.sh` scripts for which Ansible now performs.

More to come for vmware-samples#54. Stay tuned.
tenthirtyam pushed a commit that referenced this issue Oct 6, 2021
Initial introduction of Ansible use for Ubuntu :
- Adds `ansible-local` provisioner to Ubuntu builds.
- Adde an initial playbook to remove steps from the `shell` build's provisioner scripts.
- Removes steps in the `ubuntu*.sh` scripts for which Ansible now performs.

More to come for #54. Stay tuned!
@tenthirtyam tenthirtyam reopened this Oct 6, 2021
@tenthirtyam
Copy link
Collaborator Author

Still in progress. :)

@tenthirtyam tenthirtyam changed the title [ENHANCEMENT] Use ansible-local provisioner for Linux configuration and packages [ENHANCEMENT] Use ansible or ansible-local provisioner for Linux configuration and packages Oct 7, 2021
@tenthirtyam tenthirtyam changed the title [ENHANCEMENT] Use ansible or ansible-local provisioner for Linux configuration and packages [ENHANCEMENT] Use ansible provisiiner for Linux configuration and packages Oct 10, 2021
tenthirtyam pushed a commit that referenced this issue Oct 10, 2021
re: #54
- Adds the`ansible` provisioner for preparation of **Linux** builds.
   - Updates guest operating system.
   - Adds additional packages.
   - Adds CA certificate to trust authority.
- Removes use of the `file` provisioner for certificates.
- Removes Ansible steps from scripts (more to follow).
- Updates the README.md.
- Requires Ansible 2.9 or higher on the system running Packer.
- Cleanup of `build.sh`.
@tenthirtyam tenthirtyam changed the title [ENHANCEMENT] Use ansible provisiiner for Linux configuration and packages [ENHANCEMENT] Use ansible provisioner for Linux configuration and packages Oct 20, 2021
tenthirtyam pushed a commit that referenced this issue Feb 7, 2022
**Linux machine images**:
- Adds Ansible roles (`users`, `configure`, and `clean`) for Linux machine image builds. [#54](#54)
- Updates GHA to ignore Ansible since the linter errors on a required configuration.

**Windows machine images**:
- Condenses Windows machine image scripts.

**Chores**:
- Updates to minimum Packer version to `v1.7.10`.
- Updates to minimum Terraform version to `v1.1.5`.
- Resolve linter issue on` CODE_OF_CONDUCT.md`.
- Update dates in `LICENSE` and `NOTICE` to 2022.
- Simplifies terms or phrases in `build.sh`, `config.sh`, and `set-envvars.sh`
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2022
@tenthirtyam tenthirtyam removed the status/planned Planned label Sep 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.