-
Notifications
You must be signed in to change notification settings - Fork 85
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
Establish template-formula
as the go-to resource for all formula development
#21
Comments
Just an idea: document how to create a formula from this template one, inside this repository or/and in saltstack docs |
@daks I've added that to the task list above -- thanks for that suggestion. |
@myii I just wanted to say „Thank you!“ :-) |
@alxwr That's really good to hear and it makes all of this effort worthwhile. There were lots of contributions involved, including your own! Good to see that you've got We've got an upcoming issue due to wanting to implement |
@myii AFAIR we could work around the |
@alxwr So there's a reliable way to check for |
@myii Sry for the delay.:-) The second most reliable way is to compare paths:
pythonpath:
- /usr/local/bin
- /usr/local/lib/python36.zip
- /usr/local/lib/python3.6
- /usr/local/lib/python3.6/lib-dynload
- /usr/local/lib/python3.6/site-packages
saltpath:
/usr/local/lib/python3.6/site-packages/salt
pythonpath:
- /var/tmp/.root_99b0b6_salt/py3
- /var/tmp/.root_99b0b6_salt/pyall
- /var/tmp/.root_99b0b6_salt
- /usr/lib/python35.zip
- /usr/lib/python3.5
- /usr/lib/python3.5/plat-x86_64-linux-gnu
- /usr/lib/python3.5/lib-dynload
- /usr/local/lib/python3.5/dist-packages
- /usr/lib/python3/dist-packages
saltpath:
/var/tmp/.root_99b0b6_salt/pyall/salt
|
@myii there is another way to detect
def config_dir():
if '__master_opts__' in __opts__:
# run started via salt-ssh
return __opts__['__master_opts__']['config_dir']
else:
# run started via salt
return __opts__['config_dir'] Taken from: https://github.com/saltstack-formulas/openssh-formula/blob/master/_pillar/known_hosts_salt_ssh.sls |
@myii I was just going to suggest that. :-) |
Does the merge of saltstack/salt#52156 affect |
@5paceToast Appreciate you bringing that merge to our attention. A cursory look suggests that we will be able to improve our use of In terms of |
@myii in that case, it might be nice to also have a template-formula variant that applies only to the latest release, for people interested in that (i.e for development, learning and other purposes). |
@5paceToast There have been conversations about having various types of In terms of a If someone had the desire to go ahead with this idea, I'm sure there are contributors here who would be happy to offer advice along the way, either here in GitHub or in our Slack/IRC/Matrix room. An actual functioning repo in place becomes an excellent stimulus for further discussions about the merits and pitfalls of such an approach and whether it would be something worth supporting at an org level. Going back to saltstack/salt#52156 for a moment: this is only available in But from another angle, how about the idea of a |
@5paceToast Thanks to @javierbertoli, we've now got testing images for The funny thing is when I looked at the upstream merge again in more detail, I realised that there isn't any way it can be used within this formula, since it is about pillar includes. In any case, at least the discussion led to some useful outcomes. |
I noticed that too, but shortly after also noticed the include/exclude docs which claim that relative includes were added way back in 0.16.0 while parent-based (grandparent etc) includes in 2015.8. (something that might be usable in It seems like some new features sometimes get missed, and some don't even make it to the docs ( |
This issue is a collection of ideas initially taken from the log of discussions[1][2][3][4] captured in the wiki.
Visibility
template-formula
a sticky formula for the whole SaltStack Formulas project.Release tagging (for each merged PR)
bump:...
labels to use when evaluating the extent of change each PR will have on the formula. Helps when bumping version numbers for releases.bump:major
bump:minor
bump:patch
CHANGELOG
to use the format proposed by https://keepachangelog.com/en/1.0.0/:django-formula
repo.AUTHORS
file, with the primary purpose of identifying the key maintainers of the repo.salt-formula
repo.semantic-release
for this formula, including updating the changelog and updating theFORMULA
file -- feat(semantic-release): configure for this formula #35.commitlint
to warn when commit messages aren't appropriate for bumping the version number -- ci(travis): includecommitlint
stage #41.semantic-release
#42.markdown-toc
directly to update inline #43..md
with.rst
and add to RTD #69.semantic-release
(keeping this list in chronological order for the most part):vault-formula
collectd-formula
nginx-formula
cert-formula
chrony-formula
rkhunter-formula
postgres-formula
-- specific commitkeepalived-formula
systemd-formula
ufw-formula
salt-formula
fail2ban-formula
bind-formula
syslog-ng-formula
apt-formula
locale-formula
sudoers-formula
postfix-formula
iptables-formula
golang-formula
-- with follow-uplogrotate-formula
php-formula
-- with follow-updeepsea-formula
mysql-formula
libvirt-formula
openvpn-formula
sysstat-formula
dhcpd-formula
packages-formula
prometheus-formula
grafana-formula
pre-commit_semantic-release.sh
could check for the existence of thedocs
dir.semantic-release
(and/or the TOFS pattern?) can be used to mitigate the use offormula:ng
states:php-formula
:v1.0.0
php-formula#185semantic-release
run php-formula#187YAML & Jinja
map.jinja
style -- update formula with map.jinja and style guide references, improve REA… #20.map.jinja
style due todefaults.merge
vs.salt-ssh
-- Upstream bug report: 'defaults.merge' is not available when usingsalt-ssh
saltstack/salt#51605.map.jinja
style for the time being -- map.jinja: use grains.filter_by instead of defaults.merge #25.map.jinja
and add more OSes #23.map.jinja
accordingly.oscodename
-- e.g.postgres-formula
.osfinger
-- e.g.apache-formula
-- map.jinja: use grains.filter_by instead of defaults.merge #25.macros.jinja
template with common macros that "Any formulae would find useful":extra_yamls
approach outlined by @javierbertoli is another approach to solve scalability issues (awaiting sample PR).jinja_lstrip_blocks
and more specficallyjinja_trim_blocks
until the upstream issue is resolved.~
for string concatenation instead of+
.| json
instead of| tojson
, at least until2017.7
support is required -- refer back to this comment.2018.3.3
: saltstack/salt@1499c6a| json
and| tojson
, so| yaml
may be preferable (at least in certain situations), see:{%- ... %}
as a standard due to linked issues raised in this comment.is unavailable, such as
osmajorrelease
andosfinger
on Arch Linux.map.jinja
:{%- do template.update({'osmajorrelease': salt['grains.get']('osmajorrelease', 0)|int }) %}
comp_lzo:
-- insist on explicit values at all times by modifying ouryamllint
configurations based on https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.empty_values?yaml_dump.sls
(via.ssf-formula
) in all formulas so that changes to the map before and after can easily be picked up in the CI logs.TOFS pattern vs. pillar
files_switch
) -- Feature/template override and files switch #19.source_files
instead offiles
in the pillar (otherwise there are twofiles
, which will cause confusion) -- fix(tofs): usesource_files
instead offiles
#76.libtofs.jinja
instead ofmacros.jinja
, to work towards the simplest drop-in solution for other formulas -- refactor(tofs): move “files_switch” macro to “libtofs.jinja” #79.Other pillar-avoidance methods to consider
pillar.get
toconfig.get
globally (as in, for all formulas eventually).Make the formula portable
tpldir
not working in template files, see Can't use tpldir or slspath in template file saltstack/salt#41195.tplroot
throughout the formula and then changing the root directory to ensure the whole formula is using the new namespace.Documentation
docs
sub-directory..keep
to push directory structure to Git..gitignore
to preventassets
being committed (also need the proper solution for these).template-formula
wiki the central location for planning/organisation/reference.tmux-formula
postgres-formula
formula:ng
toformula
-- see fix: prevent running of states deprecated inv1.0.0
nginx-formula#236.Tests and CI
kitchen-ci
andinspec
(ortestinfra
) examples for the basic tasks (add/remove package, check service, etc) -- want to replace oldserverspec
tests -- Add a testing scaffold withkitchen-ci
,inspec
andtravis
support #34.inspec
.Goss
andsaltcheck
also mentioned -- perhaps alongside for the latter?saltscaffold
.Compare this with the formula-test-harness introduced to thenginx-formula
in this pull.opensuse
not working -- ci(kitchen): usesalt-minion
version ofopensuse
to ensure tests run #45.opensuse
usually works the second time its run), evaluate ways of minimising these delays:travis_retry
.matrix: allow_failures: - os: opensuse-leap
.salt-minion
version ofopensuse
to ensure tests run #45 -- restarts no longer required.clean
stages -- @javierbertoli looking into this.source_files
instead offiles
#76.Gemfile
, to avoid test failures -- fix(travis): use version numbers in Gemfile to prevent failed builds #81.provision_command
for each platform, as used in thesystemd-formula
-- only if actually useful, not just for the sake of it..kitchen.yml
=>kitchen.yml
-- done in refactor(kitchen): preferkitchen.yml
to.kitchen.yml
#40.pillars-from-files
=>pillars_from_files
-- done in refactor(kitchen):pillars-from-files
=>pillars_from_files
#74.States
template-formula
to not be too focussed onpkg
:pkg/install.sls
,pkg/clean.sls
,repo/install.sls
,repo/clean.sls
, etc.Repo standards
develop
branch to allow PRs with the very latest changes, that can be merged back intomaster
at the appropriate times.template-formula
as the go-to resource for all formula development #21 (comment).usergroup
) users-formula#198.Other resources to evaluate for inclusion
The text was updated successfully, but these errors were encountered: