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

Attempting to use formula is leading to error #25

Open
tekkifygamer opened this issue Mar 23, 2023 · 2 comments
Open

Attempting to use formula is leading to error #25

tekkifygamer opened this issue Mar 23, 2023 · 2 comments

Comments

@tekkifygamer
Copy link

tekkifygamer commented Mar 23, 2023

Hi there,

I've followed the saltstack formula documentation to the T but have had no success in using this formula. Each time I try to apply the state to minions I am receiving this error:


    Data failed to compile:
----------
    Pillar failed to render with the following messages:
----------
    Rendering Primary Top file failed, render error:
while parsing a block mapping
  in "<unicode string>", line 1, column 1
did not find expected key
  in "<unicode string>", line 3, column 5

The error itself seems misleading as the top.sls file is fine. Currently the pillar top.sls file looks like this:

base:
  '*':
    - freeipa.client

The state top.sls file looks like this:

base:
  '*':
    - freeipa

The current file structure is the basic saltstack defaults, this was done to rule out any gitfs issues:

Pillars are stored in /srv/pillar, with the client pillar in /srv/pillar/freeipa/client.sls

The formula is stored in /srv/salt under /srv/salt/freeipa/ . This is essentially a copy of the freeipa folder within the master repo.

Please let me know if more information required and I'd be more than happy to provide it.
Thank you for looking into my issue.

@tekkifygamer tekkifygamer changed the title Attempting to use formula as instructed is leading to error Attempting to use formula is leading to error Mar 23, 2023
@jdshewey
Copy link
Contributor

You need to post your freeipa.client pilar data - and should probably run it through a YAML linter first. Tabs vs. spaces is a big issue in YAML.

@tekkifygamer
Copy link
Author

Here's the pillar file I currently have made

freeipa:
  client:
    enabled: true
    server: freeipa.xnet.local
    domain: {{ salt['grains.get']('domain', '') }}
    realm: {{ salt['grains.get']('domain', '').upper() }}
    hostname: {{ salt['grains.get']('fqdn', '') }}
    install_principal:
      source: salt://freeipa/files/principal.keytab
      mode: "0600"
      principal_user: "xavier"
      file_user: "root"
      file_group: "root"

when I run the pillar.items command it appears that the minions are able to access the pillar data correctly.

test.xnet.local:
    ----------
    freeipa:
        ----------
        client:
            ----------
            domain:
                xnet.local
            enabled:
                True
            hostname:
                test.xnet.local
            install_principal:
                ----------
                file_group:
                    root
                file_user:
                    root
                mode:
                    0600
                principal_user:
                    xavier
                source:
                    salt://freeipa/files/principal.keytab
            realm:
                XNET.LOCAL
            server:
                freeipa.xnet.local

Thank you for taking time to look into my issue, I greatly appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants