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

Adjust role for buliding AMIs with Packer #18

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

tomaszkiewicz
Copy link

@tomaszkiewicz tomaszkiewicz commented Nov 17, 2017

Hi,

I've added a little switch I use often in Ansible for building AMI packages in AWS using Packer tool.
The thing is that while building we don't want to start the services, because they are often in unconfigured state, so setting start_services to false prevents that.

The default behaviour is unchanged, so running playbook with this role installs and starts filebeat.

The other thing I've added (only for RedHat, as I know how to do it in RH) is the environment file reference for systemd file - this is to be used in templates, where you can use env variables for dynamic configuration of filebeat.

Best regards

Łukasz Tomaszkiewicz

@tomaszkiewicz tomaszkiewicz changed the title Add start_services variable for buliding AMIs with Packer Adjust role for buliding AMIs with Packer Nov 17, 2017
@@ -17,3 +17,12 @@
state: present
notify:
- restart filebeat

- name: modify filebeat service file to include environment variables
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would probably make sense as a drop-in unit instead of modifying the unit directly: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Description

Along with a unit file foo.service, a "drop-in" directory foo.service.d/ may exist. All files with the suffix ".conf" from this directory will be parsed after the unit file itself is parsed. This is useful to alter or add configuration settings for a unit, without having to modify unit files.

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

Successfully merging this pull request may close these issues.

2 participants