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

Failed on installing redis in server mode #2

Open
autumnw opened this issue Jun 5, 2017 · 3 comments
Open

Failed on installing redis in server mode #2

autumnw opened this issue Jun 5, 2017 · 3 comments

Comments

@autumnw
Copy link

autumnw commented Jun 5, 2017

If I install redis in server mode. The pillar config as the following:

salt-call pillar.get redis
local:
----------
conf_dir:
/etc
server:
----------
bind:
----------
address:
0.0.0.0
port:
6379
protocol:
tcp
enabled:
True

I will get the following error:

      ID: /etc/redis.conf
Function: file.managed
  Result: False
 Comment: Unable to manage file: Jinja variable 'None' has no attribute 'enabled'
 Started: 21:25:45.446509
Duration: 138.781 ms
 Changes: 

The proposal fix is adding "if cluster != None" in redis.conf everywhere likes the following

{%- if cluster != None and cluster.enabled %}

BTW, this is on centos 7.
Another issue is in map.jinja, we should make the default conf_dir work:
'RedHat': {
'version': '2.8',
'pkgs': ['redis'],
'service': 'redis',
'conf_dir': '/etc',
'enabled': True,
'bind': {
'address': '127.0.0.1',
'port': '6379'
}

@austinbenincasa
Copy link

austinbenincasa commented Jul 2, 2018

I can confirm this happening on CentOS 7 as well. The changes proposed fix the issue.

@sethcenterbar
Copy link

Same issue here ✌️

@sethcenterbar
Copy link

sethcenterbar commented Mar 11, 2019

For others with this problem on centos7, i wrote a quick script to put in /srv/formulas that will fix it, basically automating @autumnw 's suggestion.

for file in $(grep -R 'cluster.enabled' salt-formula-redis/ | cut -d ':' -f 1 | uniq)
do
	echo "Fixing $file"
	sed -i 's/cluster\.enabled/cluster != None and cluster.enabled/g' $file
done

echo "Fixing configuration directory for rhel"
sed -i "s/\/etc\/redis\/redis.conf/\/etc/g" salt-formula-redis/redis/map.jinja

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

3 participants