saltstack-formulas / ufw-formula

Manages your firewall using ufw with pillar configured rules
Apache License 2.0
7 stars 37 forks source link

State 'ufw.enabled' was not found in SLS 'ufw' #4

Closed remichristiaan closed 6 years ago

remichristiaan commented 6 years ago

Hi,

I ran into a problem getting ufw-formula to work on my configuration. Hope someone can shed light on this matter.

When I run: salt-call state.apply common.ufw test=True (on the minion)

I get the following result:

----------
          ID: ufw-app-limit-Saltmaster
    Function: ufw.limit
      Result: False
     Comment: State 'ufw.limit' was not found in SLS 'ufw'
              Reason: 'ufw.limit' is not available.
     Changes:
----------
          ID: ufw-app-allow-OpenSSH
    Function: ufw.allow
      Result: False
     Comment: State 'ufw.allow' was not found in SLS 'ufw'
              Reason: 'ufw.allow' is not available.
     Changes:
----------
          ID: enable-ufw
    Function: ufw.enabled
      Result: False
     Comment: State 'ufw.enabled' was not found in SLS 'ufw'
              Reason: 'ufw.enabled' is not available.
     Changes:

Summary for local
------------
Succeeded: 7 (unchanged=1, changed=1)
Failed:    3
------------

Left out the succeeded ones

I've configured ufw-formula the same way as I did with e.g. users-formula and openssh-formula:

/srv/salt/common/init.sls

include:
  - common.ufw
  - common.openssh
  - common.packages
  - common.users

/srv/salt/common/ufw.sls

include:
  - ufw

/srv/pillar/common/init.sls

include:
  - common.ufw
  - common.openssh
  - common.users

/srv/pillar/common/ufw.sls

ufw:

  enabled: True

  settings:

    loglevel: low
    ipv6: False

  # Allow applications defined at /etc/ufw/applications.d/
  applications:

    OpenSSH:
      enabled: True
      comment: Allow access to the SSH server

    Saltmaster:
      limit: True
      comment: Limit access to the salt master

The ufw-formula was git cloned to my formula directory, registered with the master (which was restarted several times).

Your assistance in this matter is greatly appreciated.

aboe76 commented 6 years ago

can you give me the output of

salt '*' pillar.item ufw

But i think the issue is with the custom _states and _modules, these should be under the namespace ufw instead of common.ufw,

remichristiaan commented 6 years ago

Yesterday I continued configuring other formulas and restarted the salt-master several times (again) ... do not know if that did the trick, but this morning applying highstate worked :)

I ran salt '*' pillar.item ufw:

minion-01:
    ----------
    ufw:
minion-02:
    ----------
    ufw:
minion-03:
    ----------
    ufw:
        ----------
        applications:
            ----------
            OpenSSH:
                ----------
                comment:
                    Allow access to the SSH server
                enabled:
                    True
            Saltmaster:
                ----------
                comment:
                    Limit access to the salt master
                limit:
                    True
        enabled:
            True
        settings:
            ----------
            ipv6:
                False
            loglevel:
                low
minion-04:
    ----------

Then I ran: salt 'minion-2*' state.apply test=True without any failures and sub sequentially could roll it out on all minions.

I'll try to trace what differs from yesterday afternoon, but I suspect caching of some sort.

Thanks for the salt '*' pillar.item [item] command.

benosman commented 5 years ago

I ran into this problem, even though it had been working fine before, and I hadn't made any changes to the master.

The ufw pillar was populated, but for some reason the state and execution modules were not getting picked up.

To solve it I ran the following command on the master: salt '*' saltutil.sync_states

thomasrossetto commented 3 years ago

Hi, I ran in the same problem. Minion on 20.04 LTS and last version of salt. I have already tried with the tips below but it's still broke. I have troubles when i try to use ufw. Any suggestion?

cinemo-administrator commented 3 years ago

Hi, similar Issue here on ubuntu 20.04 masterless setup including ufw-formula via gitfs. Any known progress?