Merge lp:~niedbalski/charms/trusty/rsyslog-forwarder-ha/fix-1594965 into lp:charms/trusty/rsyslog-forwarder-ha

Proposed by Jorge Niedbalski
Status: Work in progress
Proposed branch: lp:~niedbalski/charms/trusty/rsyslog-forwarder-ha/fix-1594965
Merge into: lp:charms/trusty/rsyslog-forwarder-ha
Diff against target: 87 lines (+39/-1) (has conflicts)
3 files modified
config.yaml (+8/-0)
hooks/hooks.py (+21/-1)
templates/standalone.template (+10/-0)
Text conflict in config.yaml
Text conflict in hooks/hooks.py
To merge this branch: bzr merge lp:~niedbalski/charms/trusty/rsyslog-forwarder-ha/fix-1594965
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+298069@code.launchpad.net

Description of the change

This fixes bug LP: #1594965

To post a comment you must log in.
10. By Jorge Niedbalski

standalone template added

11. By Jorge Niedbalski

standalone template added

12. By Jorge Niedbalski

standalone template added

Revision history for this message
Stuart Bishop (stub) wrote :

You have merge conflict markers

Unmerged revisions

12. By Jorge Niedbalski

standalone template added

11. By Jorge Niedbalski

standalone template added

10. By Jorge Niedbalski

standalone template added

9. By Jorge Niedbalski

Fix for LP: #1594965

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2016-04-26 17:00:59 +0000
3+++ config.yaml 2016-06-21 20:50:25 +0000
4@@ -6,6 +6,7 @@
5 replication-mode:
6 type: string
7 default: fanout
8+<<<<<<< TREE
9 description: Possible options are 'fanout' or 'failover' fanout replicates the log messages over all the defined syslog relations, failover replicates the log messages just if the previous server is down. Failover always uses tcp for the protocol.
10 nagios_context:
11 default: "juju"
12@@ -32,3 +33,10 @@
13 default: "/var/log/dpkg.log /var/log/apt/history.log"
14 description: "A space separated list of files to follow with rsyslog imfile and forward to the aggregator. If set to empty string no files will be watched with imfile."
15
16+=======
17+ description: Possible options are 'fanout' or 'failover' fanout replicates the log messages over all the defined syslog relations, failover replicates the log messages just if the previous server is down.
18+ rsyslog-server:
19+ type: string
20+ default: ""
21+ description: Comma separated list of remote rsyslog servers, not managed by Juju (i.e: 10.0.0.1:514 or 10.0.0.1:514, 10.0.0.2:514)
22+>>>>>>> MERGE-SOURCE
23
24=== modified file 'hooks/hooks.py'
25--- hooks/hooks.py 2016-06-06 17:09:07 +0000
26+++ hooks/hooks.py 2016-06-21 20:50:25 +0000
27@@ -57,7 +57,6 @@
28 LOGS_SYSTEM_FILE = '/etc/rsyslog.d/50-default.conf'
29 REPLICATION_FILE = '/etc/rsyslog.d/80-rsyslog-replication.conf'
30
31-
32 hooks = Hooks()
33
34
35@@ -122,6 +121,18 @@
36 }))
37
38
39+def update_standalone(rsyslog):
40+ """
41+ Set the current mode to standalone by using the provided rsyslog server
42+ """
43+ with open(REPLICATION_FILE, 'w') as fd:
44+ fd.write(get_template('standalone').render(
45+ **{
46+ 'servers': rsyslog.split(","),
47+ }
48+ ))
49+
50+
51 def update_replication():
52 servers = session.query(Server).all()
53
54@@ -218,9 +229,18 @@
55 @hooks.hook()
56 def config_changed():
57 update_local_logs(config_get("log-locally"))
58+<<<<<<< TREE
59 update_imfile(config_get("watch-files").split())
60 update_replication()
61 update_nrpe_config()
62+=======
63+
64+ rsyslog_server = config_get('rsyslog-server')
65+ if rsyslog_server:
66+ update_standalone(rsyslog_server)
67+ else:
68+ update_replication()
69+>>>>>>> MERGE-SOURCE
70
71
72 if __name__ == "__main__":
73
74=== added file 'templates/standalone.template'
75--- templates/standalone.template 1970-01-01 00:00:00 +0000
76+++ templates/standalone.template 2016-06-21 20:50:25 +0000
77@@ -0,0 +1,10 @@
78+{% for server in servers %}
79+$ActionQueueType LinkedList # use asynchronous processing
80+$ActionQueueFileName {{ server }} # set file name, also enables disk mode
81+$ActionResumeRetryCount -1 # infinite retries on insert failure
82+$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down
83+
84+# Forward everything
85+*.* @{{server}}
86+
87+{% endfor %}

Subscribers

People subscribed via source and target branches