mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
lxc: remove useless and error prone uses_systemd knob
This commit is contained in:
parent
7ec08cd41c
commit
43fb0eff02
4 changed files with 5 additions and 42 deletions
|
@ -192,31 +192,6 @@ Driver Support
|
|||
- Image listing (LXC templates)
|
||||
- Running container information (IP addresses, etc.)
|
||||
|
||||
Systemd Check
|
||||
-------------
|
||||
|
||||
.. versionadded:: 2015.8.2
|
||||
|
||||
Some container templates might not have systemd installed resulting in errors during
|
||||
container creation time. To prevent this please set the ``uses_systemd`` option to ``False``.
|
||||
Option `uses_systemd` defaults to `True`.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
ubuntu-lxc:
|
||||
provider: dev-lxc
|
||||
lxc_profile:
|
||||
template: download
|
||||
options:
|
||||
release: trusty
|
||||
arch: amd64
|
||||
image: ubuntu
|
||||
script_args: -P
|
||||
uses_systemd: False
|
||||
network_profile: ubuntu
|
||||
minion:
|
||||
master: localhost
|
||||
|
||||
Bootstrap Delay
|
||||
---------------
|
||||
|
||||
|
|
|
@ -753,9 +753,6 @@ VALID_OPTS = {
|
|||
|
||||
# Delay in seconds before executing bootstrap (salt cloud)
|
||||
'bootstrap_delay': int,
|
||||
|
||||
# Does this lxc template have systemd installed?
|
||||
'uses_systemd': bool,
|
||||
}
|
||||
|
||||
# default configurations
|
||||
|
@ -1227,7 +1224,6 @@ CLOUD_CONFIG_DEFAULTS = {
|
|||
'log_fmt_logfile': _DFLT_LOG_FMT_LOGFILE,
|
||||
'log_granular_levels': {},
|
||||
'bootstrap_delay': None,
|
||||
'uses_systemd': True,
|
||||
}
|
||||
|
||||
DEFAULT_API_OPTS = {
|
||||
|
|
|
@ -1145,7 +1145,6 @@ def init(name,
|
|||
bootstrap_args=None,
|
||||
bootstrap_shell=None,
|
||||
bootstrap_url=None,
|
||||
uses_systemd=True,
|
||||
**kwargs):
|
||||
'''
|
||||
Initialize a new container.
|
||||
|
@ -1299,9 +1298,6 @@ def init(name,
|
|||
unconditional_install
|
||||
Run the script even if the container seems seeded
|
||||
|
||||
uses_systemd
|
||||
Set to true if the lxc template has systemd installed
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -1622,8 +1618,7 @@ def init(name,
|
|||
bootstrap_delay=bootstrap_delay,
|
||||
bootstrap_url=bootstrap_url,
|
||||
bootstrap_shell=bootstrap_shell,
|
||||
bootstrap_args=bootstrap_args,
|
||||
uses_systemd=uses_systemd)
|
||||
bootstrap_args=bootstrap_args)
|
||||
except (SaltInvocationError, CommandExecutionError) as exc:
|
||||
ret['comment'] = 'Bootstrap failed: ' + exc.strerror
|
||||
ret['result'] = False
|
||||
|
@ -3324,7 +3319,7 @@ def test_bare_started_state(name, path=None):
|
|||
return ret
|
||||
|
||||
|
||||
def wait_started(name, path=None, timeout=300, uses_systemd=True):
|
||||
def wait_started(name, path=None, timeout=300):
|
||||
'''
|
||||
Check that the system has fully inited
|
||||
|
||||
|
@ -3352,7 +3347,7 @@ def wait_started(name, path=None, timeout=300, uses_systemd=True):
|
|||
raise CommandExecutionError(
|
||||
'Container {0} is not running'.format(name))
|
||||
ret = False
|
||||
if uses_systemd and running_systemd(name, path=path):
|
||||
if running_systemd(name, path=path):
|
||||
test_started = test_sd_started_state
|
||||
logger = log.error
|
||||
else:
|
||||
|
@ -3408,8 +3403,7 @@ def bootstrap(name,
|
|||
path=None,
|
||||
bootstrap_delay=None,
|
||||
bootstrap_args=None,
|
||||
bootstrap_shell=None,
|
||||
uses_systemd=True):
|
||||
bootstrap_shell=None):
|
||||
'''
|
||||
Install and configure salt in a container.
|
||||
|
||||
|
@ -3470,7 +3464,7 @@ def bootstrap(name,
|
|||
[approve_key=(True|False)] [install=(True|False)]
|
||||
|
||||
'''
|
||||
wait_started(name, path=path, uses_systemd=uses_systemd)
|
||||
wait_started(name, path=path)
|
||||
if bootstrap_delay is not None:
|
||||
try:
|
||||
log.info('LXC {0}: bootstrap_delay: {1}'.format(
|
||||
|
|
|
@ -313,8 +313,6 @@ def init(names, host=None, saltcloud_mode=False, quiet=False, **kwargs):
|
|||
kw = copy.deepcopy(kw)
|
||||
kw['name'] = name
|
||||
saved_kwargs = {}
|
||||
if 'uses_systemd' in kw:
|
||||
saved_kwargs['uses_systemd'] = kw['uses_systemd']
|
||||
kw = client.cmd(
|
||||
host, 'lxc.cloud_init_interface', args + [kw],
|
||||
expr_form='list', timeout=600).get(host, {})
|
||||
|
|
Loading…
Add table
Reference in a new issue