Project

General

Profile

Actions

Bug #11566

closed

Database Error Salt ENC

Added by Charles Burton over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I just performed a fresh install of salt and foreman on CentOS7. I followed the guide docs per the foreman install guidelines for my OS choice. I'm trying to use the master_tops system to assign classes to my minions, but the ENC is throwing a Postgres Error. Here's the error code:

@ | Started GET "/salt/node/salt-minion1.wx.noaa.gov?format=yml" for 137.75.232.199 at 2015-08-25 15:12:57 -0400
2015-08-25 15:12:57 [app] [I] Processing by ForemanSalt::MinionsController#node as YML
2015-08-25 15:12:57 [app] [I] Parameters: {"id"=>"salt-minion1.wx.noaa.gov"}
2015-08-25 15:12:57 [app] [W] Failed to generate external nodes for salt-minion1.wx.noaa.gov with PGError: ERROR: column reference "name" is ambiguous | LINE 1: SELECT name FROM "salt_modules" INNER JOIN "salt_module_envi... | ^ | : SELECT name FROM "salt_modules" INNER JOIN "salt_module_environments" ON "salt_module_environments"."salt_module_id" = "salt_modules"."id" INNER JOIN "salt_environments" ON "salt_environments"."id" = "salt_module_environments"."salt_environment_id" WHERE "salt_module_environments"."salt_environment_id" = 1 AND "salt_modules"."id" IN (138, 139) ORDER BY salt_modules.name@

Here is my master configuration:

@
autosign_file: /etc/salt/autosign.conf

external_auth:
pam:
saltuser:
- '@runner'

master_tops:
ext_nodes: /usr/bin/foreman-node

file_roots:
base:
- /srv/salt/base/states
its:
- /srv/salt/its/states
dev:
- /srv/salt/dev/states

ext_pillar:
- puppet: /usr/bin/foreman-node

rest_cherrypy:
port: 9191
host: 0.0.0.0
ssl_crt: /var/lib/puppet/ssl/certs/salt-foreman.wx.noaa.gov.pem
ssl_key: /var/lib/puppet/ssl/private_keys/salt-foreman.wx.noaa.gov.pem

@

Here's the foreman.yaml in /etc/salt:

@
---
:proto: https
:host: salt-foreman.wx.noaa.gov
:port: 443
:ssl_ca: "/var/lib/puppet/ssl/ca/ca_crt.pem"
:ssl_cert: "/var/lib/puppet/ssl/certs/salt-foreman.wx.noaa.gov.pem"
:ssl_key: "/var/lib/puppet/ssl/private_keys/salt-foreman.wx.noaa.gov.pem"
:timeout: 10
:salt: /usr/bin/salt
:upload_grains: true

@

Sudoers entry:


#Foreman Configuration for working with Salt
Cmnd_Alias SALT = /usr/bin/salt, /usr/bin/salt-key
foreman-proxy ALL = NOPASSWD: SALT
Defaults:foreman-proxy !requiretty

Finally, the salt.yml in /etc/foreman-proxy/settings.d

@
---
:enabled: https
:autosign_file: /etc/salt/autosign.conf
:salt_command_user: root
  1. Some features require using the Salt API - such as listing environments and retrieving state info
    :use_api: true
    :api_url: https://localhost:9191
    :api_auth: pam
    :api_username: saltuser
    :api_password: XXXXXXXXXXXX
    @
Actions

Also available in: Atom PDF