Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Getting stuck with pillars and formulas.

 

Debian stable installed.

 

Trying to configure dhcpd and bind, salt '*' pillar.items shows the server can see the pillar items, and state.highstate installs the packages, but they're not configured, any ideas?

 

git cloned the dhcpd and bind formulas from https://github.com/saltstack-formulas

 

copied the pillar.example files to /srv/pillar/dhcpd/init.sls etc

 

/etc/salt/master:

file_roots:
 base:
   - /srv/salt
   - /srv/formulas/bind-formula
   - /srv/formulas/dhcpd-formula

pillar_roots:
 base:
   - /srv/pillar

 

salt/top.sls:

base:
 '*':
   - screen
 'server2.school.local':
   - bind
   - dhcpd

 

pillar/top.sls:

base:
 'server2.school.local':
   - bind
   - dhcpd

 

pillar/dhcpd/init.sls:

dhcpd:
   domain_name: linux.school.local
   domain_name_servers:
       - 192.168.0.2
       - 8.8.8.8
   default_lease_time: 600
   max_lease_time: 7200
   log_facility: local7
   subnets:
       192.168.0.0:
           comment: |
               This declaration allows BOOTP clients to get dynamic addresses,
               which we don't really recommend.
           netmask: 255.255.255.0
           dynamic_bootp: True
           range:
               - 192.168.0.40
               - 192.168.0.199
           routers: 192.168.0.1

 

salt '*' pillar.items:

server2.school.local:
   ----------
   dhcpd:
       ----------
       default_lease_time:
           600
       domain_name:
           linux.school.local
       domain_name_servers:
           - 192.168.0.2
           - 8.8.8.8
       log_facility:
           local7
       max_lease_time:
           7200
       subnets:
           ----------
           192.168.0.0:
               ----------
               comment:
                   This declaration allows BOOTP clients to get dynamic addresses,
                   which we don't really recommend.
               dynamic_bootp:
                   True
               netmask:
                   255.255.255.0
               range:
                   - 192.168.0.40
                   - 192.168.0.199
               routers:
                   192.168.0.1

 

So it seems that the client, (which is the same machine as the master btw) can see the pillar items fine.

 

And it installs screen, bind, dhcpd, all the dependencies, and tries to start dhcpd, which fails as it has no config

 

salt-call -l debug state.highstate 2> pillardebug

grep pillar pillardebug

[DEBUG   ] LazyLoaded pillar.get

is the only line, read through it all, can't see anything that stands out. Same happened with trying to configure bind.

Posted
You've told /srv/pillar/top.sls to look for /srv/pillar/dhcpd.sls and /srv/pillar/bind.sls for a minion matching 'server2.school.local'. What is the content of these files?
Posted
I put pillar/dhcpd/init.sls in the first post. But now I know the issue, was calling dhcpd, not dhcpd.config! Gah. Will be back with more problems soon I'm sure.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...