mirror of https://github.com/ansible/ansible.git
ansible-config dedupe ini plugin entries (#82498)
added test for ini file integrity, also ensuring no dupespull/82503/head
parent
623e0eee42
commit
6c2895fd88
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- ansible-config init will now dedupe ini entries from plugins.
|
@ -0,0 +1,2 @@
|
||||
shippable/posix/group5
|
||||
context/controller
|
@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import configparser
|
||||
import sys
|
||||
|
||||
|
||||
ini_file = sys.argv[1]
|
||||
c = configparser.ConfigParser(strict=True, inline_comment_prefixes=(';',))
|
||||
c.read_file(open(ini_file))
|
@ -0,0 +1,14 @@
|
||||
- name: test ansible-config for valid output and no dupes
|
||||
block:
|
||||
- name: Create temporary file
|
||||
tempfile:
|
||||
path: '{{output_dir}}'
|
||||
state: file
|
||||
suffix: temp.ini
|
||||
register: ini_tempfile
|
||||
|
||||
- name: run config full dump
|
||||
shell: ansible-config init -t all > {{ini_tempfile.path}}
|
||||
|
||||
- name: run ini tester, for correctness and dupes
|
||||
shell: "{{ansible_playbook_python}} '{{role_path}}/files/ini_dupes.py' '{{ini_tempfile.path}}'"
|
Loading…
Reference in New Issue