Re: Getting the exposed ports

2017-12-04 Thread Merlijn Sebrechts
Hm, I wonder why the iptables charm is doing that. from charms.reactive.bus import State class states(StateList): connected = State('{relation_name}.connected') joined = State('{relation_name}.joined') departed = State('{relation_name}.departed') The internals of charms.reactive have change

Re: Getting the exposed ports

2017-12-02 Thread Tom Barber
So I did take a look at the iptables charm https://api.jujucharms.com/charmstore/v5/~majduk/iptables-3/archive/hooks/relations/peer-discovery/peers.py is sad on my setup. unit-iptables-0: 22:08:53 DEBUG unit.iptables/0.install   File "/var/lib/juju/agents/unit-iptables-0/charm/hooks/relations/

Re: Getting the exposed ports

2017-12-02 Thread John Meinel
If it works, great. But I have the feeling we only run in a hook context for units and so opened-ports isn't available for a machine. (There are no machine level hooks, as applications are always unit level) John =:-> On Dec 2, 2017 13:30, "Merlijn Sebrechts" wrote: > Yes, so with juju-run you

Re: Getting the exposed ports

2017-12-02 Thread Merlijn Sebrechts
Yes, so with juju-run you could run 'opened-ports' in the hook context of each unit on that machine, and this get all the opened+ports on the machine. On 2 Dec 2017 04:26, "John Meinel" wrote: > I'm pretty sure that opened-ports only reports the ports that Juju had > opened for the charm that is

Re: Getting the exposed ports

2017-12-01 Thread John Meinel
I'm pretty sure that opened-ports only reports the ports that Juju had opened for the charm that is making the request. I don't think we list all ports opened on the machine for all other applications. So you might need to have a relation that can report it's opened ports to the subordinate John

Re: Getting the exposed ports

2017-12-01 Thread Michał Ajduk
Hello, You can take a look at iptables charm. It does the "easy part", that is admin defined ruleset. I was actually thinking of making it also use the open ports. I'm pretty sure juju-info relation has the open ports data, but I can take a look. BR, Michal 01.12.2017 16:52 "Tom Barber" napis

Re: Getting the exposed ports

2017-12-01 Thread Merlijn Sebrechts
Maybe somebody has a better way, I think running `opened-ports` using `juju-run` might do the trick. 2017-12-01 16:51 GMT+01:00 Tom Barber : > Hello folks > > I want to write a firewall charm for those deployments that aren't in the > cloud. The "easy" thing to do is provide a config block and ha

Getting the exposed ports

2017-12-01 Thread Tom Barber
Hello folks I want to write a firewall charm for those deployments that aren't in the cloud. The "easy" thing to do is provide a config block and have admins write in rules and just apply them. I was wondering though, if I wrote a subordinate charm on juju-info to attach to anything, is there