Merge lp://qastaging/~louis/charms/trusty/rsyslog-forwarder-ha/add_forward_hosts into lp://qastaging/charms/trusty/rsyslog-forwarder-ha

Proposed by Louis Bouchard
Status: Merged
Merged at revision: 18
Proposed branch: lp://qastaging/~louis/charms/trusty/rsyslog-forwarder-ha/add_forward_hosts
Merge into: lp://qastaging/charms/trusty/rsyslog-forwarder-ha
Diff against target: 148 lines (+97/-5)
3 files modified
config.yaml (+7/-1)
hooks/hooks.py (+9/-2)
tests/unit/test_basic.py (+81/-2)
To merge this branch: bzr merge lp://qastaging/~louis/charms/trusty/rsyslog-forwarder-ha/add_forward_hosts
Reviewer Review Type Date Requested Status
Jorge Niedbalski (community) Approve
Jorge Niedbalski Pending
Review via email: mp+309120@code.qastaging.launchpad.net

Description of the change

Add 'forward_hosts' parameter to provide a list of rsyslog listeners that are not juju-deployed.
Test coverage also included.

To post a comment you must log in.
Revision history for this message
Jorge Niedbalski (niedbalski) wrote :

Hello Louis,

Thank you for submitting this fix.

I deployed this charm on the following environment:

[Environment]
UPGRADE-AVAILABLE
1.25.6

[Services]
NAME STATUS EXPOSED CHARM
external active false cs:xenial/ubuntu-8
rsyslog-forwarder-ha false local:trusty/rsyslog-forwarder-ha-0
ubuntu active false cs:trusty/ubuntu-8

[Units]
ID WORKLOAD-STATE AGENT-STATE VERSION MACHINE PORTS PUBLIC-ADDRESS MESSAGE
external/0 active idle 1.25.5.1 4 10.5.0.41 ready
ubuntu/3 active idle 1.25.5.1 5 10.5.0.42 ready
  rsyslog-forwarder-ha/0 unknown idle 1.25.5.1 10.5.0.42

[Machines]
ID STATE VERSION DNS INS-ID SERIES HARDWARE
0 started 1.25.5.1 10.5.0.37 d459cd19-5ea2-4d96-b187-13fc8e4117af xenial arch=amd64 cpu-cores=1 mem=1536M root-disk=10240M availability-zone=nova
4 started 1.25.5.1 10.5.0.41 82aac885-f27b-450f-a221-a6c65c68104a xenial arch=amd64 cpu-cores=1 mem=1536M root-disk=10240M availability-zone=nova
5 started 1.25.5.1 10.5.0.42 813f9b99-bdeb-4a6f-8838-546720998853 trusty arch=amd64 cpu-cores=1 mem=1536M root-disk=10240M availability-zone=nova

Then I related ubuntu with rsyslog-forwarder-ha, and then I did set the forward_hosts option:

ubuntu@niedbalski-bastion:~$ juju set rsyslog-forwarder-ha forward_hosts=external=10.5.0.41

The resulting configuration looks like:

$ActionQueueType LinkedList # use asynchronous processing
$ActionQueueFileName external # set file name, also enables disk mode
$ActionResumeRetryCount -1 # infinite retries on insert failure
$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down

# Forward everything

*.* @10.5.0.41:514

The logs are being forwarder to the remote rsyslog server, I did run the lint/tests
also. All seems good.

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches