Repository navigation
Description
Description of Issue
service reload not executed when reload and enable both set to True and the service is in disabled state
Setup
# top.sls
base:
'*':
- nginx# nginx.sls
nginx:
pkg.installed: []
service.running:
- enable: True
- reload: True
- watch:
- pkg: nginx
- file: /etc/nginx/conf.d/test.conf
/etc/nginx/conf.d/test.conf:
file.managed:
- source: salt://test.confserver {
listen 8080 default_server;
listen [::]:8080 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
}Steps to Reproduce Issue
- Disable nginx service by systemd
- modify test.conf file
- execute nginx state
sudo systemctl disable nginx
sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-23 04:13:53 PDT; 27s ago
Docs: man:nginx(8)
Main PID: 2974 (nginx)
Tasks: 3 (limit: 2359)
Memory: 4.1M
CGroup: /system.slice/nginx.service
├─2974 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─2975 nginx: worker process
└─2976 nginx: worker process
Oct 23 04:13:53 debian9.localdomain systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 23 04:13:53 debian9.localdomain systemd[1]: Started A high performance web server and a reverse proxy server.
sudo salt-call -l debug state.sls nginx
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG ] Using cached minion ID from /etc/salt/minion_id: 112r01
[DEBUG ] Configuration file path: /etc/salt/minion
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[DEBUG ] Grains refresh requested. Refreshing grains.
[DEBUG ] Reading configuration from /etc/salt/minion
[DEBUG ] Including configuration from '/etc/salt/minion.d/_schedule.conf'
[DEBUG ] Reading configuration from /etc/salt/minion.d/_schedule.conf
[DEBUG ] /etc/resolv.conf: The domain and search keywords are mutually exclusive.
[DEBUG ] Connecting to master. Attempt 1 of 1
[DEBUG ] Master URI: tcp://127.0.0.1:4506
[DEBUG ] Popen(['git', 'version'], cwd=/home/vagrant, universal_newlines=False, shell=None)
[DEBUG ] Popen(['git', 'version'], cwd=/home/vagrant, universal_newlines=False, shell=None)
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Generated random reconnect delay between '1000ms' and '11000ms' (8984)
[DEBUG ] Setting zmq_reconnect_ivl to '8984ms'
[DEBUG ] Setting zmq_reconnect_ivl_max to '11000ms'
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', 'clear')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG ] Decrypting the current master AES key
[DEBUG ] salt.crypt.get_rsa_key: Loading private key
[DEBUG ] salt.crypt._get_key_with_evict: Loading private key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] salt.crypt.get_rsa_pub_key: Loading public key
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] Connecting the Minion to the Master publish port, using the URI: tcp://127.0.0.1:4505
[DEBUG ] salt.crypt.get_rsa_key: Loading private key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Determining pillar cache
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', u'aes')
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] salt.crypt.get_rsa_key: Loading private key
[DEBUG ] Loaded minion key: /etc/salt/pki/minion/minion.pem
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] LazyLoaded state.sls
[DEBUG ] LazyLoaded direct_call.execute
[DEBUG ] LazyLoaded saltutil.is_running
[DEBUG ] LazyLoaded grains.get
[DEBUG ] LazyLoaded config.get
[DEBUG ] key: test, ret: _|-
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', u'aes')
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] Gathering pillar data for state run
[DEBUG ] Finished gathering pillar data for state run
[INFO ] Loading fresh modules for state activity
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] In saltenv 'base', looking at rel_path 'nginx.sls' to resolve 'salt://nginx.sls'
[DEBUG ] In saltenv 'base', ** considering ** path '/var/cache/salt/minion/files/base/nginx.sls' to resolve 'salt://nginx.sls'
[DEBUG ] compile template: /var/cache/salt/minion/files/base/nginx.sls
[DEBUG ] Jinja search path: [u'/var/cache/salt/minion/files/base']
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', u'aes')
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/nginx.sls' using 'jinja' renderer: 0.0314271450043
[DEBUG ] Rendered data from file: /var/cache/salt/minion/files/base/nginx.sls:
nginx:
pkg.installed: []
service.running:
- enable: True
- reload: True
- watch:
- pkg: nginx
- file: /etc/nginx/conf.d/test.conf
/etc/nginx/conf.d/test.conf:
file.managed:
- source: salt://test.conf
[DEBUG ] Results of YAML rendering:
OrderedDict([(u'nginx', OrderedDict([(u'pkg.installed', []), (u'service.running', [OrderedDict([(u'enable', True)]), OrderedDict([(u'reload', True)]), OrderedDict([(u'watch', [OrderedDict([(u'pkg', u'nginx')]), OrderedDict([(u'file', u'/etc/nginx/conf.d/test.conf')])])])])])), (u'/etc/nginx/conf.d/test.conf', OrderedDict([(u'file.managed', [OrderedDict([(u'source', u'salt://test.conf')])])]))])
[PROFILE ] Time (in seconds) to render '/var/cache/salt/minion/files/base/nginx.sls' using 'yaml' renderer: 0.00100207328796
[DEBUG ] LazyLoaded config.option
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] LazyLoaded pkg.install
[DEBUG ] LazyLoaded pkg.installed
[DEBUG ] key: ifttt.secret_key, ret: _|-
[DEBUG ] key: ifttt:secret_key, ret: _|-
[ERROR ] Unable to determine systemd version from systemctl --version, output follows:
systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
[ERROR ] nspawn: Unable to determine systemd version
[DEBUG ] key: pushbullet.api_key, ret: _|-
[DEBUG ] key: pushbullet:api_key, ret: _|-
[DEBUG ] LazyLoaded systemd.booted
[DEBUG ] key: victorops.api_key, ret: _|-
[DEBUG ] key: victorops:api_key, ret: _|-
[DEBUG ] DSC: Only available on Windows systems
[DEBUG ] Module PSGet: Only available on Windows systems
[DEBUG ] LazyLoaded platform.is_windows
[DEBUG ] Could not LazyLoad pkg.ex_mod_init: 'pkg.ex_mod_init' is not available.
[INFO ] Running state [nginx] at time 04:15:26.605749
[INFO ] Executing state pkg.installed for [nginx]
[DEBUG ] Could not LazyLoad pkg.resolve_capabilities: 'pkg.resolve_capabilities' is not available.
[INFO ] Executing command [u'dpkg-query', u'--showformat', u'${Status} ${Package} ${Version} ${Architecture}', u'-W'] in directory '/root'
[DEBUG ] Could not LazyLoad pkg.normalize_name: 'pkg.normalize_name' is not available.
[INFO ] All specified packages are already installed
[INFO ] Completed state [nginx] at time 04:15:26.692178 (duration_in_ms=86.428)
[DEBUG ] LazyLoaded service.running
[DEBUG ] LazyLoaded file.managed
[INFO ] Running state [/etc/nginx/conf.d/test.conf] at time 04:15:26.702056
[INFO ] Executing state file.managed for [/etc/nginx/conf.d/test.conf]
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', u'aes')
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] In saltenv 'base', looking at rel_path 'test.conf' to resolve 'salt://test.conf'
[DEBUG ] In saltenv 'base', ** considering ** path '/var/cache/salt/minion/files/base/test.conf' to resolve 'salt://test.conf'
[DEBUG ] Fetching file from saltenv 'base', ** attempting ** 'salt://test.conf'
[DEBUG ] No dest file found
[INFO ] Fetching file from saltenv 'base', ** done ** 'test.conf'
[DEBUG ] LazyLoaded files.is_text
[DEBUG ] LazyLoaded stringutils.get_diff
[INFO ] File changed:
---
+++
@@ -2,9 +2,7 @@
listen 8080 default_server;
listen [::]:8080 default_server;
-
root /var/www/html;
-
index index.html index.htm index.nginx-debian.html;
server_name localhost;
[INFO ] Completed state [/etc/nginx/conf.d/test.conf] at time 04:15:26.777277 (duration_in_ms=75.219)
[INFO ] Running state [nginx] at time 04:15:26.778576
[INFO ] Executing state service.running for [nginx]
[INFO ] Executing command [u'systemctl', 'status', u'nginx.service', u'-n', u'0'] in directory '/root'
[DEBUG ] stdout: * nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-23 04:13:53 PDT; 1min 33s ago
Docs: man:nginx(8)
Main PID: 2974 (nginx)
Tasks: 3 (limit: 2359)
Memory: 4.1M
CGroup: /system.slice/nginx.service
|-2974 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
|-2975 nginx: worker process
`-2976 nginx: worker process
[ERROR ] Unable to determine systemd version from systemctl --version, output follows:
systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
[INFO ] Executing command [u'systemctl', 'is-active', u'nginx.service'] in directory '/root'
[DEBUG ] stdout: active
[INFO ] Executing command [u'systemctl', 'is-enabled', u'nginx.service'] in directory '/root'
[DEBUG ] stdout: disabled
[DEBUG ] retcode: 1
[DEBUG ] sysvinit script 'sysstat' found, but systemd unit 'sysstat.service' already exists
[DEBUG ] sysvinit script 'rsyslog' found, but systemd unit 'rsyslog.service' already exists
[DEBUG ] sysvinit script 'dbus' found, but systemd unit 'dbus.service' already exists
[DEBUG ] sysvinit script 'ssh' found, but systemd unit 'ssh.service' already exists
[DEBUG ] sysvinit script 'procps' found, but systemd unit 'procps.service' already exists
[DEBUG ] sysvinit script 'networking' found, but systemd unit 'networking.service' already exists
[DEBUG ] sysvinit script 'unbound' found, but systemd unit 'unbound.service' already exists
[DEBUG ] sysvinit script 'udev' found, but systemd unit 'udev.service' already exists
[DEBUG ] sysvinit script 'rsync' found, but systemd unit 'rsync.service' already exists
[DEBUG ] sysvinit script 'prometheus' found, but systemd unit 'prometheus.service' already exists
[DEBUG ] sysvinit script 'salt-minion' found, but systemd unit 'salt-minion.service' already exists
[DEBUG ] sysvinit script 'nginx' found, but systemd unit 'nginx.service' already exists
[DEBUG ] sysvinit script 'smartmontools' found, but systemd unit 'smartmontools.service' already exists
[DEBUG ] sysvinit script 'haveged' found, but systemd unit 'haveged.service' already exists
[DEBUG ] sysvinit script 'unattended-upgrades' found, but systemd unit 'unattended-upgrades.service' already exists
[DEBUG ] sysvinit script 'ipmievd' found, but systemd unit 'ipmievd.service' already exists
[DEBUG ] sysvinit script 'atd' found, but systemd unit 'atd.service' already exists
[DEBUG ] sysvinit script 'postfix' found, but systemd unit 'postfix.service' already exists
[DEBUG ] sysvinit script 'cron' found, but systemd unit 'cron.service' already exists
[DEBUG ] sysvinit script 'memcached' found, but systemd unit 'memcached.service' already exists
[DEBUG ] sysvinit script 'salt-master' found, but systemd unit 'salt-master.service' already exists
[DEBUG ] sysvinit script 'x11-common' found, but systemd unit 'x11-common.service' already exists
[DEBUG ] sysvinit script 'kmod' found, but systemd unit 'kmod.service' already exists
[DEBUG ] sysvinit script 'apparmor' found, but systemd unit 'apparmor.service' already exists
[DEBUG ] sysvinit script 'prometheus-node-exporter' found, but systemd unit 'prometheus-node-exporter.service' already exists
[DEBUG ] sysvinit script 'ntp' found, but systemd unit 'ntp.service' already exists
[DEBUG ] sysvinit script 'sudo' found, but systemd unit 'sudo.service' already exists
[ERROR ] Unable to determine systemd version from systemctl --version, output follows:
systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
[INFO ] Executing command [u'systemctl', 'is-enabled', u'nginx.service'] in directory '/root'
[DEBUG ] stdout: disabled
[DEBUG ] retcode: 1
[DEBUG ] sysvinit script 'sysstat' found, but systemd unit 'sysstat.service' already exists
[DEBUG ] sysvinit script 'rsyslog' found, but systemd unit 'rsyslog.service' already exists
[DEBUG ] sysvinit script 'dbus' found, but systemd unit 'dbus.service' already exists
[DEBUG ] sysvinit script 'ssh' found, but systemd unit 'ssh.service' already exists
[DEBUG ] sysvinit script 'procps' found, but systemd unit 'procps.service' already exists
[DEBUG ] sysvinit script 'networking' found, but systemd unit 'networking.service' already exists
[DEBUG ] sysvinit script 'unbound' found, but systemd unit 'unbound.service' already exists
[DEBUG ] sysvinit script 'udev' found, but systemd unit 'udev.service' already exists
[DEBUG ] sysvinit script 'rsync' found, but systemd unit 'rsync.service' already exists
[DEBUG ] sysvinit script 'prometheus' found, but systemd unit 'prometheus.service' already exists
[DEBUG ] sysvinit script 'salt-minion' found, but systemd unit 'salt-minion.service' already exists
[DEBUG ] sysvinit script 'nginx' found, but systemd unit 'nginx.service' already exists
[DEBUG ] sysvinit script 'smartmontools' found, but systemd unit 'smartmontools.service' already exists
[DEBUG ] sysvinit script 'haveged' found, but systemd unit 'haveged.service' already exists
[DEBUG ] sysvinit script 'unattended-upgrades' found, but systemd unit 'unattended-upgrades.service' already exists
[DEBUG ] sysvinit script 'ipmievd' found, but systemd unit 'ipmievd.service' already exists
[DEBUG ] sysvinit script 'atd' found, but systemd unit 'atd.service' already exists
[DEBUG ] sysvinit script 'postfix' found, but systemd unit 'postfix.service' already exists
[DEBUG ] sysvinit script 'cron' found, but systemd unit 'cron.service' already exists
[DEBUG ] sysvinit script 'memcached' found, but systemd unit 'memcached.service' already exists
[DEBUG ] sysvinit script 'salt-master' found, but systemd unit 'salt-master.service' already exists
[DEBUG ] sysvinit script 'x11-common' found, but systemd unit 'x11-common.service' already exists
[DEBUG ] sysvinit script 'kmod' found, but systemd unit 'kmod.service' already exists
[DEBUG ] sysvinit script 'apparmor' found, but systemd unit 'apparmor.service' already exists
[DEBUG ] sysvinit script 'prometheus-node-exporter' found, but systemd unit 'prometheus-node-exporter.service' already exists
[DEBUG ] sysvinit script 'ntp' found, but systemd unit 'ntp.service' already exists
[DEBUG ] sysvinit script 'sudo' found, but systemd unit 'sudo.service' already exists
[DEBUG ] sysvinit script 'sysstat' found, but systemd unit 'sysstat.service' already exists
[DEBUG ] sysvinit script 'rsyslog' found, but systemd unit 'rsyslog.service' already exists
[DEBUG ] sysvinit script 'dbus' found, but systemd unit 'dbus.service' already exists
[DEBUG ] sysvinit script 'ssh' found, but systemd unit 'ssh.service' already exists
[DEBUG ] sysvinit script 'procps' found, but systemd unit 'procps.service' already exists
[DEBUG ] sysvinit script 'networking' found, but systemd unit 'networking.service' already exists
[DEBUG ] sysvinit script 'unbound' found, but systemd unit 'unbound.service' already exists
[DEBUG ] sysvinit script 'udev' found, but systemd unit 'udev.service' already exists
[DEBUG ] sysvinit script 'rsync' found, but systemd unit 'rsync.service' already exists
[DEBUG ] sysvinit script 'prometheus' found, but systemd unit 'prometheus.service' already exists
[DEBUG ] sysvinit script 'salt-minion' found, but systemd unit 'salt-minion.service' already exists
[DEBUG ] sysvinit script 'nginx' found, but systemd unit 'nginx.service' already exists
[DEBUG ] sysvinit script 'smartmontools' found, but systemd unit 'smartmontools.service' already exists
[DEBUG ] sysvinit script 'haveged' found, but systemd unit 'haveged.service' already exists
[DEBUG ] sysvinit script 'unattended-upgrades' found, but systemd unit 'unattended-upgrades.service' already exists
[DEBUG ] sysvinit script 'ipmievd' found, but systemd unit 'ipmievd.service' already exists
[DEBUG ] sysvinit script 'atd' found, but systemd unit 'atd.service' already exists
[DEBUG ] sysvinit script 'postfix' found, but systemd unit 'postfix.service' already exists
[DEBUG ] sysvinit script 'cron' found, but systemd unit 'cron.service' already exists
[DEBUG ] sysvinit script 'memcached' found, but systemd unit 'memcached.service' already exists
[DEBUG ] sysvinit script 'salt-master' found, but systemd unit 'salt-master.service' already exists
[DEBUG ] sysvinit script 'x11-common' found, but systemd unit 'x11-common.service' already exists
[DEBUG ] sysvinit script 'kmod' found, but systemd unit 'kmod.service' already exists
[DEBUG ] sysvinit script 'apparmor' found, but systemd unit 'apparmor.service' already exists
[DEBUG ] sysvinit script 'prometheus-node-exporter' found, but systemd unit 'prometheus-node-exporter.service' already exists
[DEBUG ] sysvinit script 'ntp' found, but systemd unit 'ntp.service' already exists
[DEBUG ] sysvinit script 'sudo' found, but systemd unit 'sudo.service' already exists
[ERROR ] Unable to determine systemd version from systemctl --version, output follows:
systemd 241 (241)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid
[INFO ] Executing command [u'systemctl', 'enable', u'nginx.service'] in directory '/root'
[DEBUG ] stderr: Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
Created symlink /etc/systemd/system/multi-user.target.wants/nginx.service -> /lib/systemd/system/nginx.service.
[INFO ] Executing command [u'systemctl', 'is-enabled', u'nginx.service'] in directory '/root'
[DEBUG ] stdout: enabled
[INFO ] {u'nginx': True}
[INFO ] Completed state [nginx] at time 04:15:27.636164 (duration_in_ms=857.589)
[DEBUG ] File /var/cache/salt/minion/accumulator/140552093430736 does not exist, no need to cleanup
[DEBUG ] LazyLoaded state.check_result
[DEBUG ] Initializing new AsyncZeroMQReqChannel for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506', u'aes')
[DEBUG ] Initializing new AsyncAuth for (u'/etc/salt/pki/minion', u'112r01', u'tcp://127.0.0.1:4506')
[DEBUG ] Connecting the Minion to the Master URI (for the return server): tcp://127.0.0.1:4506
[DEBUG ] Trying to connect to: tcp://127.0.0.1:4506
[DEBUG ] Closing AsyncZeroMQReqChannel instance
[DEBUG ] LazyLoaded highstate.output
[DEBUG ] LazyLoaded nested.output
[DEBUG ] LazyLoaded nested.output
local:
----------
ID: nginx
Function: pkg.installed
Result: True
Comment: All specified packages are already installed
Started: 04:15:26.605750
Duration: 86.428 ms
Changes:
----------
ID: /etc/nginx/conf.d/test.conf
Function: file.managed
Result: True
Comment: File /etc/nginx/conf.d/test.conf updated
Started: 04:15:26.702058
Duration: 75.219 ms
Changes:
----------
diff:
---
+++
@@ -2,9 +2,7 @@
listen 8080 default_server;
listen [::]:8080 default_server;
-
root /var/www/html;
-
index index.html index.htm index.nginx-debian.html;
server_name localhost;
----------
ID: nginx
Function: service.running
Result: True
Comment: Service nginx has been enabled, and is in the desired state
Started: 04:15:26.778575
Duration: 857.589 ms
Changes:
----------
nginx:
True
Summary for local
------------
Succeeded: 3 (changed=2)
Failed: 0
------------
Total states run: 3
Total run time: 1.019 s
sudo systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2019-10-23 04:13:53 PDT; 7min ago
Docs: man:nginx(8)
Main PID: 2974 (nginx)
Tasks: 3 (limit: 2359)
Memory: 4.1M
CGroup: /system.slice/nginx.service
├─2974 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
├─2975 nginx: worker process
└─2976 nginx: worker process
Oct 23 04:13:53 debian9.localdomain systemd[1]: Starting A high performance web server and a reverse proxy server...
Oct 23 04:13:53 debian9.localdomain systemd[1]: Started A high performance web server and a reverse proxy server.Versions Report
(I've tested version 2018.3, it has the same problem too)
sudo salt --versions-report
Salt Version:
Salt: 2019.2.0
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.11
ioflo: Not Installed
Jinja2: 2.10
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.16 (default, Apr 6 2019, 01:42:57)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.1.2
RAET: Not Installed
smmap: 2.0.5
timelib: Not Installed
Tornado: 5.1.1
ZMQ: 4.3.1
System Versions:
dist: debian 10.0
locale: UTF-8
machine: x86_64
release: 4.19.0-5-amd64
system: Linux
version: debian 10.0
Activity
vinian commentedon Oct 25, 2019
I'm trying to split the
reloadandenable, and it worksnginx: pkg.installed: [] service.running: - enable: True reload_nginx_if_needed: service.running: - name: nginx - reload: True - watch: - pkg: nginx - file: /etc/nginx/conf.d/test.conf /etc/nginx/conf.d/test.conf: file.managed: - source: salt://test.conflocal: ---------- ID: nginx Function: pkg.installed Result: True Comment: All specified packages are already installed Started: 22:47:46.672350 Duration: 50.598 ms Changes: ---------- ID: nginx Function: service.running Result: True Comment: Service nginx has been enabled, and is in the desired state Started: 22:47:46.725702 Duration: 576.865 ms Changes: ---------- nginx: True ---------- ID: /etc/nginx/conf.d/test.conf Function: file.managed Result: True Comment: File /etc/nginx/conf.d/test.conf updated Started: 22:47:47.306434 Duration: 33.384 ms Changes: ---------- diff: --- +++ @@ -8,6 +8,7 @@ server_name localhost; + location / { try_files $uri $uri/ =404; } ---------- ID: reload_nginx_if_needed Function: service.running Name: nginx Result: True Comment: Service reloaded Started: 22:47:47.367784 Duration: 52.173 ms Changes: ---------- nginx: True Summary for local ------------ Succeeded: 4 (changed=3) Failed: 0 ------------ Total states run: 4 Total run time: 713.020 msAnd i've test other directive
restart,full_restart, it seems all of them will not be executed when theenableis set and the service is in disabled states, is it design to work like this?And someone seems have reported a long time ago. #43922
stale commentedon Jan 7, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
sagetherage commentedon Jan 9, 2020
@xeacott can you triage this ticket in the next 7 days, please? or should I get someone else to triage?
stale commentedon Jan 9, 2020
Thank you for updating this issue. It is no longer marked as stale.
xeacott commentedon Jan 21, 2020
I recall a meeting in the last few weeks where something very similar to this question was discussed and I do believe this is intended behavior. Apologies for a delay in responding.
stale commentedon Feb 20, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
sagetherage commentedon Feb 21, 2020
ok stale bot, stale not
stale commentedon Feb 21, 2020
Thank you for updating this issue. It is no longer marked as stale.
sagetherage commentedon Feb 21, 2020
@Akm0d can you help Joe to follow up, here, please?
stale commentedon Mar 22, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
mitar commentedon Nov 27, 2026
I made a PR to address this: #70974