-
Notifications
You must be signed in to change notification settings - Fork 42
chore: use Ansible's built-in replace instead of sed #2048
Conversation
.ci/ansible/playbook.yml
Outdated
sed -i '' -e 's,http://package-registry:8080,https://epr-staging.elastic.co,g' /home/{{ansible_user}}/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml | ||
ansible.builtin.replace: | ||
path: "/home/{{ ansible_user }}/e2e-testing/cli/config/compose/profiles/fleet/default/kibana.config.yml" | ||
regexp: '^{{ item.old }}$' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original sed didn't use ^
and $
but a global search, maybe those limited flags should not be used just in case the content of the file includes spaces or any other special chars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doubting about that, yeah. I was following the official docs for the built-in task and thought they were needed: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html#parameter-regexp
I've been following the pipeline and it seems to work fine (https://beats-ci.elastic.co/blue/organizations/jenkins/e2e-tests%2Fe2e-testing-mbp/detail/PR-2048/1/pipeline/312), but we can remove those tokens if not needed.
[2022-01-24T12:32:02.554Z] TASK [Configure stack files] ***************************************************
[2022-01-24T12:32:03.492Z] ok: [13.59.150.119] => (item={'old': 'http://elasticsearch', 'new': 'http://13.59.150.119'})
[2022-01-24T12:32:04.060Z] ok: [13.59.150.119] => (item={'old': 'http://fleet-server', 'new': 'http://13.59.150.119'})
[2022-01-24T12:32:04.996Z] ok: [13.59.150.119] => (item={'old': 'http://package-registry:8080', 'new': 'https://epr-staging.elastic.co'})
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0)
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0)
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0)
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0) Co-authored-by: Manuel de la Peña <[email protected]>
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0) Co-authored-by: Manuel de la Peña <[email protected]>
* chore: use Ansible's built-in replace instead of sed * chore: whitespace variable * chore: simplify regexp (cherry picked from commit 6b930a0) Co-authored-by: Manuel de la Peña <[email protected]>
* main: (45 commits) feat: add CentOS 8 support (elastic#2034) fix: set default region for AWS cli (elastic#2053) chore: use Ansible's built-in replace instead of sed (elastic#2048) chore: split stack configuration and start into two tasks (elastic#2044) feat: enable SSH access to users for debugging cloud instances (elastic#2001) fix: use the right branch for 7.17 backports (elastic#2025) SLES15 enablement (elastic#2007) chore: bump stale agent for main (elastic#2014) Update `fetchBeatsBinary` to be reused in elastic-agent-poc (elastic#1984) chore: add resiliency when provisioning the stack (elastic#1990) chore: bump elastic-package to v0.32.1 (elastic#1959) feat: export Fetch&Download methods in the /pkg directory (elastic#1943) bump stack version 8.1.0-dbc834fd (elastic#1948) bump stack version 8.1.0-76902d39 (elastic#1946) chore: retire 7.15 adding 7.17 (elastic#1938) ci: use withAPMEnv (elastic#1917) Update main branch (elastic#1928) bump stack version 8.1.0-befff95a (elastic#1929) chore: properly evaluate how tests are skipped on CI when checking modified files (elastic#1924) bump stack version 8.1.0-60bffc32 (elastic#1921) ...
What does this PR do?
Instead of sed, it uses Ansible's built-in command for replacing strings in Kibana config file
Why is it important?
We are seeing sed errors in Ansible execution
Checklist
make unit-test
), and they are passing locallymake notice
in the proper directory)Related issues