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

Release/v23.34 #187

Merged
merged 71 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
247f245
Merge pull request #290 from EnterpriseDB/rc/v23.33
RichardPooleEDB Jun 24, 2024
3256813
Wait in first backup when backing up a replica
RichardPooleEDB Jun 21, 2024
b1b0c8a
Bump pipdeptree from 2.22.0 to 2.23.0
dependabot[bot] Jun 23, 2024
1e9d964
Bump black from 24.2.0 to 24.3.0 in /tpa-ee/aap24
dependabot[bot] Jun 18, 2024
cf4dc28
Bump pylint from 3.2.3 to 3.2.5
dependabot[bot] Jun 30, 2024
95f0118
Update upstream_primary after switchover
jdnevin May 8, 2024
683bc99
Delegate run_once execution to current upstream_primary node
jdnevin Jun 17, 2024
666c918
Refactor efm/switchover role, move upstream_primary logic to new file
jdnevin Jun 19, 2024
39daa0b
Make symlink for efm.properties template, add copyright
jdnevin Jul 1, 2024
68bd14e
Change symlink to use relative path
jdnevin Jul 2, 2024
94e4fdb
Change no_log back to true for encrypt efm pass
jdnevin Jul 3, 2024
b736525
Remove support for RAID volume creation on AWS
gonzalemario Jun 4, 2024
a8edd4a
Bump pyfakefs from 5.5.0 to 5.6.0
dependabot[bot] Jul 14, 2024
77c2778
Bump zipp from 3.17.0 to 3.19.1 in /tpa-ee/aap24
dependabot[bot] Jul 9, 2024
76d2f21
Refactor agent.config.j2 template, add release notes
jdnevin Jul 8, 2024
f835edb
Changes related to efm properties
EFM-Bobby Jun 26, 2024
9a5781b
Fix incorrect cgroup detection
RichardPooleEDB Jun 26, 2024
3908723
Update matrix.yml
jdnevin Jul 3, 2024
abcdb47
Add tpa-ee build requirements to worklow
JonathanRenon-EDB Jul 4, 2024
9014244
Bump pipdeptree from 2.23.0 to 2.23.1
dependabot[bot] Jul 14, 2024
aeb93c8
Remove multiple location when using patroni
gonzalemario Jul 15, 2024
32630f1
Use `create-or-update-comment` in `validate_relnotes.yml`
barthisrael Jul 19, 2024
7a6debe
fixup cgroupv2
JonathanRenon-EDB Jul 19, 2024
26a67ab
Honour postgres_port when connecting to primary
nick-ivanov-edb Jul 19, 2024
d874769
Add default pgd proxy and cli pkg for SUSE
Jul 8, 2024
a5d381e
Correctly handle failover_manager override for SO nodes and replicas
haroon-github Jul 19, 2024
146ada0
Add read_listen_port support in test
JonathanRenon-EDB Jul 23, 2024
396d351
Fix `tpaexec test` step in integration tests
JonathanRenon-EDB Jul 22, 2024
4089d31
Add relnotes
JonathanRenon-EDB Jul 23, 2024
8b3dab0
Ensure idempotency ensure that tasks that don't make change don't rep…
JonathanRenon-EDB Jul 19, 2024
3ff9d4f
Ensure homogeneous formattingmake mode parameter always use the same …
JonathanRenon-EDB Jul 19, 2024
4dace39
Add logic to provide SSL certs for PEM server
jdnevin Jul 19, 2024
baef96c
Change certificate and key variable names to be more specific
jdnevin Jul 22, 2024
75bf1da
Add documentation
jdnevin Jul 23, 2024
29d0589
Refactor certificate generation
jdnevin Jul 25, 2024
0487990
Update cert directory, refactor docs and release notes
jdnevin Jul 26, 2024
ec04040
Refactor conditional for self-signed certificate generation
jdnevin Jul 29, 2024
9a4ec52
Support passing options when registering PEM agent
jdnevin Jul 11, 2024
a7c1d5a
Include documentation, refactor registration_options as task var
jdnevin Jul 25, 2024
1eb509a
Update release note
jdnevin Jul 25, 2024
08d67ec
Update roles/pem/agent/config/final/tasks/main.yml
jdnevin Jul 26, 2024
fb626c0
Run the upgrade-conf command as efm user
JonathanRenon-EDB Jul 9, 2024
851b6f1
Add release note entry
JonathanRenon-EDB Jul 19, 2024
daeb19c
Update efm properties template
EFM-Bobby Jul 26, 2024
b63b355
Fix ephemeral check
JonathanRenon-EDB Jul 25, 2024
dcc94bd
Add efm-bind-by-hostname option for M1 + efm
JonathanRenon-EDB Jul 26, 2024
7bc6cb1
Flush handlers at the end of the postgres role
RichardPooleEDB Aug 8, 2024
cd41da9
Add efm-pre-config hook
RichardPooleEDB Aug 15, 2024
79db064
Provide cert authentication for pgbouncer
gonzalemario Jul 15, 2024
f4ff60d
Enable 'directories' setting in dependabot
gonzalemario Jul 23, 2024
13ba0f8
TPA-specific stdout callback plugin
RichardPooleEDB Jun 25, 2024
384b95e
Determine upstream_primary without EFM dependency
jdnevin Aug 8, 2024
9ae4018
Remove references to 2Q repos and repos 1.0 from docs
sonotley Jul 23, 2024
6dffeae
Update default Debian/Ubuntu os version for aws
haroon-github Aug 16, 2024
c674946
Ignore proxy settings when accessing the Patroni API
gcedb Aug 14, 2024
7b59d2f
Set "directories" content to the right format
gonzalemario Aug 19, 2024
8ec16d0
Add missing ppc64le req file
JonathanRenon-EDB Jul 16, 2024
d06504f
Update dependencies to the latest available versions
JonathanRenon-EDB Aug 2, 2024
4587a32
add hashes back for unchanged version deps
JonathanRenon-EDB Aug 2, 2024
01e838e
Bump cryptography==43.0.0 and psutil=6.0.0 on ppc64
gonzalemario Aug 19, 2024
1c2b757
Remove ARM64 requirement file
gonzalemario Aug 19, 2024
f23ff64
Add cryptography PPC64 hash in requirements-ansible-8.txt
gonzalemario Aug 20, 2024
7a2c942
Bump pytest from 8.2.2 to 8.3.2
dependabot[bot] Aug 19, 2024
dbe938d
Bump jq from 1.7.0 to 1.8.0
dependabot[bot] Aug 18, 2024
af7c220
Explicitly install httpd for PEM
sonotley Aug 19, 2024
9317abd
Add pgbouncer to our integration tests
gonzalemario Aug 14, 2024
423d9c3
Move TPA-580 release note
jdnevin Aug 21, 2024
b7a8449
Automated release notes for v23.34
github-actions[bot] Aug 21, 2024
47f2526
Update release date for v23.34
jdnevin Aug 21, 2024
65c7857
Update release date for v23.34
jdnevin Aug 21, 2024
0cbbc89
Merge pull request #358 from EnterpriseDB/rc/v23.34
jdnevin Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TPA-specific stdout callback plugin
The new plugin "tpa" writes task output to stdout, writing only
one line for each task. Each task name is followed by three colour-coded
numbers: a green one showing how many hosts successfully executed the
task, a blue one showing how many hosts skipped the task, and a pink one
showing how many hosts failed to run the task, if the task is marked
with "ignore_errors: true".

Tasks are indented according to include levels.

If you set the TPA_STANDARD_OUTPUT environment variable to a truthy
value, or set the standard_plugin option in ansible.cfg, or use -v on
the command line, the TPA output plugin will behave just like the
default one. This effectively enables ad-hoc flipping between the two
output styles.

References: TPA-778, TPA-673
  • Loading branch information
RichardPooleEDB authored and haroon-github committed Aug 16, 2024
commit 13ba0f89c13ab578430c483300c7a154f73eeba6
1 change: 1 addition & 0 deletions ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ retry_files_enabled = no
retry_files_save_path = ~/.ansible-retry
inject_facts_as_vars = true
force_valid_group_names=ignore
stdout_callback=tpa

[inventory]
unparsed_is_failed = true
Expand Down
275 changes: 275 additions & 0 deletions lib/callback_plugins/tpa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
# testing how things work

from __future__ import absolute_import, division, print_function

__metaclass__ = type

DOCUMENTATION = """
callback: tpa
short_description: TPA's own Ansible screen output
version_added: "2.2"
description:
- this callback shows all tasks as one line of output
extends_documentation_fragment:
- default_callback
- result_format_callback
type: stdout
requirements:
- set as stdout in config
options:
standard_plugin:
description: show output equivalent to the default plugin
type: bool
ini:
- section: default
- key: standard_plugin
env:
- name: TPA_USE_DEFAULT_OUTPUT
default: false



"""

import inspect

from ansible import constants as C
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
from ansible.utils.color import stringc


class CallbackModule(CallbackModule_default):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = "stdout"
CALLBACK_NAME = "tpa"

def zero_everything(self):
self._ok = 0
self._skipped = 0
self._failed = 0
self._next_task_uuid = None
self._uuid_stack = []
self._task_name = ""
self._use_standard_plugin = False
self._errors = []
self._output_lines = []
self._pending_output_line = False

def __init__(self, display=None):
self._super = super(CallbackModule, self)
self._super.__init__()
self.zero_everything()

def v2_playbook_on_include(self, included_file):
# this is only called for non-role includes
if self._use_standard_plugin:
self._super.v2_playbook_on_include(included_file)
else:
self._task_name += " " + included_file._filename.partition("roles/")[2]

def v2_playbook_on_task_start(self, task, is_conditional):
if self._use_standard_plugin:
self._super.v2_playbook_on_task_start(task, is_conditional)
else:
# show counters for already-finished task
self._show_task_counters()

self._task_name = task.get_name().strip()
self._task_uuid = task._uuid
self._output_lines = []

# if this isn't the task we were expecting, that's because the last task
# was an include that got expanded
if self._task_uuid != self._next_task_uuid:
self._uuid_stack.append(self._next_task_uuid)

if self._task_uuid in self._uuid_stack:
while self._task_uuid != self._uuid_stack[-1]:
self._uuid_stack.pop()
self._uuid_stack.pop()

# to establish the expected next task, we look at our caller's iterator
stack = inspect.stack() # list of FrameInfo
try:
strategy_frame = stack[3].frame
iterator = strategy_frame.f_locals["iterator"]

next_task = iterator.all_tasks[iterator.cur_task] #
if next_task is not None:
self._next_task_uuid = next_task._uuid
finally:
del strategy_frame
del iterator

self._ok = 0
self._skipped = 0
self._failed = 0

self._show_task_lead_line()

def v2_playbook_on_play_start(self, play):
if self._use_standard_plugin:
self._super.v2_playbook_on_play_start(play)
else:
self.zero_everything()
name = play.get_name().strip()
if not name:
msg = "PLAY"
else:
msg = "PLAY [%s]" % (name)
self._current_play = play

self._display.banner(msg)

def v2_playbook_on_stats(self, stats):
if not self._use_standard_plugin:
self._show_task_counters()

self._super.v2_playbook_on_stats(stats)

def v2_runner_on_start(self, host, task):
if self._use_standard_plugin:
self._super.v2_runner_on_start(host, task)

def v2_runner_on_ok(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_ok(result)
else:
if result._task.action in C._ACTION_DEBUG:
self._output_lines.append(
f"{result._host.get_name()} => { result._result['msg'] }"
)
self._ok += 1

def v2_runner_on_failed(self, result, ignore_errors=False):
if self._use_standard_plugin:
self._super.v2_runner_on_failed(result, ignore_errors)
else:
if not ignore_errors:
host_label = self.host_label(result)
self._errors.append(
"fatal: [%s]: FAILED! => %s"
% (
host_label,
self._dump_results(result._result),
)
)

self._failed += 1

def v2_runner_on_skipped(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_skipped(result)
else:
self._skipped += 1

def v2_runner_on_unreachable(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_unreachable(result)
else:
host_label = self.host_label(result)
self._errors.append(
"fatal: [%s]: UNREACHABLE! => %s"
% (
host_label,
self._dump_results(result._result),
)
)

self._failed += 1

def v2_playbook_on_no_hosts_matched(self):
if self._use_standard_plugin:
self._super.v2_playbook_on_no_hosts_matched()

def v2_playbook_on_no_hosts_remaining(self):
if self._use_standard_plugin:
self._super.v2_playbook_on_no_hosts_remaining()

def v2_playbook_on_cleanup_task_start(self, task):
if self._use_standard_plugin:
self._super.v2_playbook_on_cleanup_task_start(task)

def v2_playbook_on_handler_task_start(self, task):
if self._use_standard_plugin:
self._super.v2_playbook_on_handler_task_start(task)

def v2_on_file_diff(self, result):
if self._use_standard_plugin:
self._super.v2_on_file_diff(result)

def v2_runner_item_on_ok(self, result):
if self._use_standard_plugin:
self._super.v2_runner_item_on_ok(result)

def v2_runner_item_on_failed(self, result):
if self._use_standard_plugin:
self._super.v2_runner_item_on_failed(result)

def v2_runner_item_on_skipped(self, result):
if self._use_standard_plugin:
self._super.v2_runner_item_on_skipped(result)

def v2_playbook_on_start(self, playbook):
if self.get_option("standard_plugin") or self._display.verbosity > 0:
self._display.display("Switching to standard plugin")
self._use_standard_plugin = True
if self._use_standard_plugin:
self._super.v2_playbook_on_start(playbook)

def v2_runner_retry(self, result):
if self._use_standard_plugin:
self._super.v2_runner_retry(result)

def v2_runner_on_async_poll(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_async_poll(result)

def v2_runner_on_async_ok(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_async_ok(result)

def v2_runner_on_async_failed(self, result):
if self._use_standard_plugin:
self._super.v2_runner_on_async_failed(result)

def v2_playbook_on_notify(self, handler, host):
if self._use_standard_plugin:
self._super.v2_playbook_on_notify(handler, host)

def _show_task_lead_line(self):
def _suppress_task(name):
return name.endswith(("set_fact", "assert", "meta"))

if not _suppress_task(self._task_name):
self._pending_output_line = True
indents = len(self._uuid_stack) * " "
self._display.display("%s%s" % (indents, self._task_name), newline=False)

def _show_task_counters(self):
error_color = C.COLOR_WARN
if self._errors:
error_color = C.COLOR_ERROR
indents = len(self._uuid_stack) * " "

if self._pending_output_line:
self._pending_output_line = False
self._display.display(
" (%s/%s/%s)"
% (
stringc(str(self._ok), C.COLOR_OK),
stringc(str(self._skipped), C.COLOR_SKIP),
stringc(str(self._failed), error_color),
),
screen_only=True,
)
self._display.display(
"%s %s ok, %s skipped, %s failed"
% (indents, self._ok, self._skipped, self._failed),
log_only=True,
)

for error in self._errors:
self._display.display("%s%s" % (indents, error), C.COLOR_ERROR)
for line in self._output_lines:
self._display.display("%s%s" % (indents, line), C.COLOR_OK)
21 changes: 21 additions & 0 deletions release_notes/TPA-778.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
- summary: Change default output to TPA's own format
description: |
Ansible's default output plugin shows a lot of information, much of
which is useful when debugging but obscures the flow of information if
you just want to see what TPA is doing. TPA now has its own output
plugin, which shows one line of information per task, omitting tasks
for which even one line would be uninformative. The lines are indented
to enable TPA's control flow to be visible, and include colour-coded
counts of successful, skipped, and ignored hosts.

The fuller output can be turned on by setting TPA_USE_DEFAULT_OUTPUT=true
in your environment, or by adding the -v switch to the command line.
# Possible types: notable_change, minor_change, bugfix or breaking_change
type: notable_change
# At least one between jira_tickets or support_tickets must be defined. You
# can define both if you want
# You must have at least one list item in each *_tickets section that is
# defined
jira_tickets:
- TPA-673
- TPA-778