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

A bit more examples #7

Open
rogierlommers opened this issue Nov 8, 2022 · 1 comment
Open

A bit more examples #7

rogierlommers opened this issue Nov 8, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@rogierlommers
Copy link

Is it possible to add more examples? For example, I would like to see if PETS can replace my Ansible stuff on my home server. I have runbooks for this:

  • Install packages, set config
  • Install docker, put docker-compose files in place
  • Add stuff to crontab
  • Create symlinks to my dotfiles
  • Add samba mounts
  • Install and config ssmtp
  • etc
@ema ema added documentation Improvements or additions to documentation good first issue Good for newcomers labels Nov 14, 2022
ema added a commit that referenced this issue Nov 16, 2022
ema added a commit that referenced this issue Nov 16, 2022
@ema
Copy link
Owner

ema commented Nov 16, 2022

Hi!

Thanks for your interest in the project.

* Install packages, set config

That is what all examples under https://github.com/ema/pets/tree/master/sample_pet do. :-)

* Install docker, put docker-compose files in place

I'm not familiar with docker-compose, but I imagine something like this is what you're looking for:

# pets: destfile=/etc/docker-compose/whatever, owner=root, group=root, mode=0644
# pets: package=docker.io

[docker compose config here]
* Add stuff to crontab

See c92d49e.

* Create symlinks to my dotfiles

Symlinks are not supported yet.

* Install and config ssmtp

See fd74910.

At the end of the day, pets focuses on the following:

  • installing configuration files where you want them to be installed
  • fixing permissions
  • installing packages
  • running commands before/after files are updated

The first two things are done with the destfile directive, while packages are installed with the package directive. pre and post can be used for running commands, see https://github.com/ema/pets/blob/master/sample_pet/ssh/sshd_config as an example.

Please feel free to contribute any additional example that you think may be of interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants