ansible-consul icon indicating copy to clipboard operation
ansible-consul copied to clipboard

consul role failed to compare windows paths in 'list_current_service_config' and 'managed_files'

Open since81 opened this issue 4 years ago • 2 comments

Hi there,

consul role failed to compare windows paths in 'list_current_service_config' and 'managed_files' because win_find returns path with drive letter and ''.

Expected output:

TASK [consul : Set fact with list of existing configuration files] *******************************************************************************************************************************************************************************************************************************************
ok: [tlm-d-web001] => (item={'creationtime': 1591783451.8057208, 'isshared': False, 'isarchive': True, 'isreadonly': False, 'extension': '.json', 'ishidden': False, 'isdir': False, 'islnk': False, 'lastwritetime': 1591793402.7714276, 'size': 320, 'owner': 'BUILTIN\\Administrators', 'checksum': '98fba0895cae8f7b67cde04d09cebf279799c167', 'attributes': 'Archive, NotContentIndexed', 'lastaccesstime': 1591783451.8057208, 'path': 'C:\\ProgramData\\consul\\config.d\\service_app.json', 'filename': 'service_app.json'})

TASK [consul : Set fact with list of service we manage] ****************************************************************************************************************************************************************************************************************************************************************
ok: [tlm-d-web001] => (item={'name': 'app', 'tags': [ 'development', 'prometheus', 'frontend'], 'port': '1240', 'checks': [{'name': 'metric_port', 'http': 'http://localhost:1240/metrics', 'interval': '30s', 'timeout': '5s'}], 'weights': [{'passing': 10, 'warning': 1}]})

TASK [consul : Delete non declared services [Windows]] *****************************************************************************************************************************************************************************************************************************************************************
skipping: [tlm-d-web001] => (item=/ProgramData/consul/config.d/service_app.json)

Got:

TASK [consul : Set fact with list of existing configuration files] *****************************************************************************************************************************************************************************************************************************************************
ok: [tlm-d-web001] => (item={'creationtime': 1591783451.8057208, 'isshared': False, 'isarchive': True, 'isreadonly': False, 'extension': '.json', 'ishidden': False, 'isdir': False, 'islnk': False, 'lastwritetime': 1591793402.7714276, 'size': 320, 'owner': 'BUILTIN\\Administrators', 'checksum': '98fba0895cae8f7b67cde04d09cebf279799c167', 'attributes': 'Archive, NotContentIndexed', 'lastaccesstime': 1591783451.8057208, 'path': 'C:\\ProgramData\\consul\\config.d\\service_app.json', 'filename': 'service_app.json'})

TASK [consul : Set fact with list of service we manage] ****************************************************************************************************************************************************************************************************************************************************************
ok: [tlm-d-web001] => (item={'name': 'app', 'tags': ['development', 'prometheus', 'frontend'], 'port': '1240', 'checks': [{'name': 'metric_port', 'http': 'http://localhost:1240/metrics', 'interval': '30s', 'timeout': '5s'}], 'weights': [{'passing': 10, 'warning': 1}]})

TASK [consul : Delete non declared services [Windows]] *****************************************************************************************************************************************************************************************************************************************************************
changed: [tlm-d-web001] => (item=C:\ProgramData\consul\config.d\service_app.json)

Versions: python-version: 3.6.8 ansible-version: 2.9.9 os-version: Windows 2016 consul: v1.7.3

Best regards, Pavlo.

since81 avatar Jun 10 '20 14:06 since81

i have pr for this

since81 avatar Jun 11 '20 13:06 since81

hi @sonericrus did you ever submit a PR for this?

lanefu avatar Jul 13 '20 02:07 lanefu