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

[bug] OpenBSD service flag setting doesn't handle quotes correctly #77891

Open
1 task done
epsilon-0 opened this issue May 24, 2022 · 1 comment
Open
1 task done

[bug] OpenBSD service flag setting doesn't handle quotes correctly #77891

epsilon-0 opened this issue May 24, 2022 · 1 comment
Labels
affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@epsilon-0
Copy link

Summary

When setting the service flags for an OpenBSD service, quotes around any argument are removed by default.

Case in point, openldap service slapd needs to have its listen ip arguments in an quoted string, such as -h 'ldaps:// ldap:// ldapi:// ldapi://%2ftmp%2fslapd.sock ldapi://%2fvar%2fwww%2ftmp%2fslapd.sock', which needs to be set in ansible with the quotes escaped, i.e. -h \'ldaps:// ldap:// ldapi:// ldapi://%2ftmp%2fslapd.sock ldapi://%2fvar%2fwww%2ftmp%2fslapd.sock\'

Because of this, the service task always shows up as changed, even when nothing actually gets changed.

Issue Type

Bug Report

Component Name

service

Ansible Version

$ ansible --version
ansible [core 2.12.2]
  config file = /home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg
  configured module search path = ['/home/aisha/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/aisha/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/lib/python-exec/python3.9/ansible
  python version = 3.9.11 (main, Mar 18 2022, 17:29:23) [GCC 11.2.1 20220115]
  jinja version = 3.0.3
  libyaml = True

Configuration

$ ansible-config dump --only-changed -t all
ANSIBLE_PIPELINING(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True
DEFAULT_BECOME(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True
DEFAULT_BECOME_METHOD(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = doas
DEFAULT_HOST_LIST(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = ['/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/inventory.ini']
DEFAULT_STDOUT_CALLBACK(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = debug
DEFAULT_TIMEOUT(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = 60
RETRY_FILES_ENABLED(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = False

BECOME:
======

CACHE:
=====

CALLBACK:
========

CLICONF:
=======

CONNECTION:
==========

local:
_____
pipelining(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True

psrp:
____
pipelining(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True

ssh:
___
timeout(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = 60

winrm:
_____
pipelining(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True

HTTPAPI:
=======

INVENTORY:
=========

LOOKUP:
======

NETCONF:
=======

SHELL:
=====

sh:
__
world_readable_temp(/home/aisha/GIT/OBSD-Homelab/OBSD-Homelab/ansible.cfg) = True

VARS:
====

OS / Environment

Controller OS - Gentoo
Target OS - OpenBSD current

Steps to Reproduce

- name: enable openldap service
  service:
    name: slapd
    enabled: true
    args: -u openldap -g openldap -F /etc/slapd.d -h \'ldaps:// ldap:// ldapi://\'

Expected Results

Repeated runs of this should not show as changed.

Actual Results

Task shows up as changed every time it is run.

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot
Copy link
Contributor

ansibot commented May 24, 2022

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 24, 2022
@mkrizek mkrizek added P3 Priority 3 - Approved, No Time Limitation needs_verified This issue needs to be verified/reproduced by maintainer and removed needs_triage Needs a first human triage before being processed. labels May 24, 2022
@epsilon-0 epsilon-0 changed the title [bug] OpenBSD service flag setting doesn't handler quotes correctly [bug] OpenBSD service flag setting doesn't handle quotes correctly Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.12 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_verified This issue needs to be verified/reproduced by maintainer P3 Priority 3 - Approved, No Time Limitation support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

No branches or pull requests

3 participants