32 Commits

Author SHA1 Message Date
David Ames
18d0a891db Allow GRE traffic in converged architecture
In a converged architecture with storage and compute on the same
host, UFW can get in the way of tunneled traffic interpreting it as
INVALID. UFW makes solving this more difficult than it needs to be.
See http://northernmost.org/blog/gre-tunnels-and-ufw/index.html for
context.

This change updates /etc/ufw/before.rules to add GRE as an allowed
input.

Also, guarantee ufw is installed for LP #1763716

Please review and merge charm-helpers first:
https://github.com/juju/charm-helpers/pull/170

Change-Id: I789854c33e3af12f7412633dbf7c921beb0ed2b5
Closes-Bug: #1757564
Closes-Bug: #1763716
2018-05-03 21:42:46 +02:00
Liam Young
6346a7458b Use the loop device in fstab instead of image file
When adding an fstab entry for a loopback device use the explicit
loopback device name rather than the source image file. This prevents
a new loopback device being created implitcitly when mounting the
image.

The unit tests needed updating to reflect that the loopback
device name is used when creating mountpoint names rather than than
the name of the image file. This was pre-existing behaviour.

Change-Id: Ide074310bf7121f1179e0b5237dff6f3da88e24e
Closes-Bug: #1762390
2018-04-10 12:58:05 +00:00
Liam Young
f75bd9762a Fix broken fstab entry
Whitespace between the fstab option is not valid, remove it.

Change-Id: I1be789acc7bf92811f8d4e2c0f0661ebf3be1678
Closes-Bug: #1762105
2018-04-10 11:25:14 +00:00
Felipe Reyes
1d28ceb648 Resolve hostnames if needed to allow access in ufw
In some cases juju 1.25 (with maas 1.9) may return a hostname in the
private-address field breaking the assumption that private-address will
always be an IP address. This patch uses get_host_ip() to assure an IP
address is given to ufw.

Change-Id: Ib99852c645517cf316adcd02d04428b248fc9724
Closes-Bug: 1747516
2018-03-05 18:16:57 -03:00
Frode Nordahl
b819bde429 Revert "Resolve hostnames if needed to allow access in ufw"
We need a new proposal that uses get_host_ip from charmhelpers.contrib.network.ip

Reference: https://review.openstack.org/#/c/542381/

This reverts commit 4896ac5b5b98f66cfe79c3945680ac0ac5dbb2bf.

Change-Id: Idd16369be776a10ac6332d7d8b2ce65f9f1ad972
2018-03-01 15:19:49 +00:00
Felipe Reyes
4896ac5b5b Resolve hostnames if needed to allow access in ufw
In some cases juju 1.25 (with maas 1.9) may return a hostname in the
private-address field breaking the assumption that private-address will
always be an IP address. This patch uses socket.getaddrinfo() to assure
an IP address is given to ufw.

Change-Id: I99b0110beed6075164eb549ec2433071af699c04
Closes-Bug: 1747516
2018-02-05 18:32:52 -03:00
David Ames
5368af6302 Swift storage ACLs
Ensure that only the swift-proxy units and swift-storage peers have
access to direct communication with swift storage daemons.

Charm-helpers sync to include ufw module and the ingress_address and
iter_units_for_relation_name functions.

Please review and merge first:
https://github.com/juju/charm-helpers/pull/35

Closes-Bug: #1727463

Change-Id: Id5677edbc40b0b891cbe66867d39d076a94c5436
2017-11-07 10:24:53 -08:00
Edward Hope-Morley
656e79da18 Catch blkid error when device is not yet formatted
When a new device is added to the ring we first try to
identify whether the device is already in the ring by
polling for an fs uuid. If the device has never been
used this is expected to fail so lets catch the error.

Also fixes log message.

Change-Id: I20354dedfa27a6b8dec92828cabb50a20d0d8838
Closes-Bug: 1567198
2017-09-14 13:22:25 -06:00
Billy Olsen
d6061caa2c Only change owner/permissions of new devices
Do not change owner and permissions of already existing
devices in the setup_storage() function as this runs
during every config-changed hook invocation.

Change-Id: I21f23aee34d315ccb4df303527b4d791fc043f58
Closes-Bug: #1676728
2017-06-08 16:03:16 -07:00
Alex Kavanagh
d8199f07bb Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: If253c8a18886630fcc7de4cfc2a91a15c2563eb5
Related-Bug: #1659575
2017-04-28 14:02:41 +01:00
vnathan
b268ef82fa Fixed handling duplicate block devices specified in config
Change-Id: I5c96c49d47b762fecc16c8700ef6ed65bcd39bf5
closes-bug: 1582317
2016-11-14 22:13:57 +05:30
James Page
cae0a2c4f5 Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: I75009a66ce9c9d43e234f9c5acbb185ac4a66ba5
2016-09-20 13:32:28 +01:00
James Page
fc1943af8f Use JUJU_MODEL_UUID for Juju 2.0
Juju 2.0 renames the environment variable JUJU_ENV_UUID
to JUJU_MODEL_UUID; use this environment variable as a
fallback if JUJU_ENV_UUID is not set to support Juju 2.0,
whilst continuing to provide support for Juju < 2.0.

Change-Id: I0e9ebbe59032e3d15864ee1f9bd49b404b339a3b
Closes-Bug: 1572575
2016-05-24 15:19:44 +01:00
Edward Hope-Morley
e7bf2f910e Allow devices to be added post-install
Track devices that have been added to the ring and allow
devices to be added to the ring post-install (currently
only allowed within the install hook). Devices added to
the ring prior to this patch existing will be migrated
to the tracking store of devices to avoid conflicts.

Change-Id: Id268dc6369041a4d2db6f30a997dfa0c0d73b93f
Closes-Bug: 1383390
2016-03-07 22:25:29 +00:00
James Page
2ceda02a08 Resync charm-helpers
Resolve single unit deployment failure with default configuration;
update unit tests to ensure that mkdir is called for /srv/node.

Change-Id: Id5518a2144ec3bdc6341f6dfc85835ae342f490e
2016-03-03 11:50:13 +00:00
James Page
9d042778d2 Resync helpers, refactor code to use cpu calcs from charmhelpers 2016-01-30 13:37:50 +01:00
Jorge Niedbalski
977be11131 Also use defaults options, just in case 2015-11-02 18:40:22 -03:00
Jorge Niedbalski
4b29d1b533 Also use defaults options, just in case 2015-11-02 17:05:25 -03:00
Jorge Niedbalski
5fe42ca12f Checks if a given device is a loop device, then adds the 'loop'
option to the mount.
2015-11-02 16:50:56 -03:00
Corey Bryant
d0a420127b Add comment 2015-10-13 13:07:27 +00:00
Corey Bryant
cd57171aa4 Add assess_status() callback 2015-10-13 09:18:52 +00:00
Corey Bryant
a65385dfe8 Lint and unit test updates 2015-10-09 12:08:09 +00:00
Corey Bryant
1a02c96e7e Drop assess_status() as it's duplicating work done by set_os_workload_status(). 2015-10-09 12:00:26 +00:00
Corey Bryant
e57d8793e5 Move to using REQUIRED_INTERFACES and check for swift-hash. 2015-10-09 03:47:26 +00:00
Corey Bryant
3c3064f723 Initial workload status support. 2015-10-08 02:15:44 +00:00
Liam Young
705077f8cd Add comment to get_mount_point 2015-10-02 11:43:29 +01:00
Liam Young
54dab0004d Fix up unit tests 2015-10-02 11:40:33 +01:00
Liam Young
563e7f23a7 Include mounted devices when reporting back to swift proxy 2015-09-30 18:19:22 +00:00
Adam Collard
15f0748932 Expand list-comp to full for-loop, use SWIFT_SVCS instead of ACCOUNT + CONTAINER + OBJECT (ack's review) 2015-09-02 11:52:38 +01:00
Adam Collard
c0c2ec36e1 Guard service restarts for upgrade case with is_paused 2015-08-28 13:40:23 +01:00
Adam Collard
b6b4e2357f SWIFT_SVCS was an out of date list of services that the charm starts, redefine it in terms of the individual components of account, container and object. Update tests. 2015-08-11 14:59:31 +01:00
Adam Collard
a3ab496153 Add lib, move library code there. Symlink into hooks directory. 2015-07-17 10:57:19 +01:00