Redis not started on startup
Cannot 'start' redis. Set redis_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
Should be done with salt
Redis not started on startup
Cannot 'start' redis. Set redis_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.
Should be done with salt
rOPS Nasqueron Operations | |||
D3359 | rOPS23c4d4f80a1c Deploy Redis |
That requires two steps:
Configuration options should be in /usr/local/etc/rc.d/redis.
An example of how it's done for Vault:
# ------------------------------------------------------------- # Service # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% if grains["os"] == "FreeBSD" %} /etc/rc.conf.d/vault: file.managed: - makedirs: True - mode: 644 - contents: | vault_enable="YES" vault_syslog_output_enable="YES" {% endif %} service_vault: service.running: - name: vault - enable: True
The service configuration file needs to be:
Variables can of course also be defined in /etc/rc.conf, but rc.conf.d allows us to manage it from different part of the Salt repository.
Instead of using contents, it's also possible to provision a file, like for iodine: https://devcentral.nasqueron.org/D3291
It also needs PostgreSQL launched at startup, but that's already defined in the role dbserver-pgsql.
By applying it:
$ salt-call --local state.sls_id /etc/rc.conf.d/postgresql roles/dbserver-pgsql/server/service /home/dereckson/dev/python/ops3/lib/python3.11/site-packages/salt/utils/pycrypto.py:27: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13 import crypt [CRITICAL] Specified ext_pillar interface tower is unavailable local: ---------- ID: /etc/rc.conf.d/postgresql Function: file.managed Result: True Comment: File /etc/rc.conf.d/postgresql updated Started: 22:07:05.103851 Duration: 5.079 ms Changes: ---------- diff: New file mode: 0644 Summary for local ------------ Succeeded: 1 (changed=1) Failed: 0 ------------ Total states run: 1 Total run time: 5.079 ms $ sudo /usr/local/etc/rc.d/postgresql status pg_ctl: directory "/var/db/postgres/data" does not exist
We use /var/db/postgres/data15 on WindRiver <- we removed the version on the role to avoid to edit the whole role at each upgrade.
I've renamed the directory to /var/db/postgres/data, works like a charm.