31 Commits

Author SHA1 Message Date
Nick Huber
a2fe2e6613 Don't echo "Stopping $space" on restart
DEV-2560
2019-08-08 15:08:48 -07:00
Nick Huber
7ec7208ad3 Also remove the generated space configured when trying to restart
The actual restart might fail in such a way that it doesn't get into the
other parts of the code, so just preempt this by removing the
configuration early.

DEV-2560
2019-08-08 10:57:08 -07:00
Nick Huber
6720cb8180 Also cleanup teh space configuration in the stop function
DEV-2560
2019-08-06 15:28:09 -07:00
Nick Huber
5a56a06148 Always clean up space bird configuration
Also silence some output from errors on deleting links and rules that
may not exist.

DEV-2560
2019-08-02 14:48:28 -07:00
Brandon Cazander
f37d869965 Support running check-policy-rules for a specific space
DEV-2512
2019-07-12 15:11:24 -07:00
Brandon Cazander
a9e1264524 Update docs to show systemd template usage
The yap service on aggregators also no longer runs `yap
check-policy-rules` as this would almost always log the following on
boot:

    Unable to connect to server control socket (/var/run/bonding/pwan-outside-bird.sock): No such file or directory

The individual space services run this check after start on their
specific space.

DEV-2512
2019-07-12 15:03:41 -07:00
Brandon Cazander
ac1c94e1c0 Switch to systemd service templates for space management
There is a new service template for yap spaces:

    systemctl status yap-space@<space key>.service

The running of the services is managed by the main yap service still,
which reads the configuration expressed through salt and runs the
relevant systemctl commands to start/stop spaces as required. See:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Service%20Templates

Some other fixes included:
- Remove empty lines in /etc/yap/config file with jinja2 control characters
- Fix `stop_unknown` function which previously wouldn't remove leftover ip
  rules
- Specifically lock around bulk operations like `start_all` instead of
  around running yap in any capacity. Running operations on specific
  spaces will also not lock anymore so that multiple spaces can be
  started simultaneously.
- Defer adding VLAN interfaces until space is up and running in bird to
  avoid having to clean this up if it fails.

Fixes DEV-2512
2019-07-12 14:45:42 -07:00
Nick Huber
662ad04fbd Use a simple type with Restart=on-failure to be more resllient
The 'start-all' had to be moved to an ExecStartPre so that the service
can detect a failure, since anything in ExecStart will be considered a
success due to RemainAfterExit=True. See
https://github.com/systemd/systemd/issues/3396 for more details.

DEV-2457
2019-06-21 11:37:49 -07:00
Brandon Cazander
570012443c Don't try to enable spaces that don't have a VLAN set
Also clean up the custom IP/bird configuration on an aggregator when
deleting a space.

DEV-2459
2019-06-20 16:25:07 -07:00
Nick Huber
4605133dbf Use a file lock to ensure only 1 yap command is running at a time
This prevents some conditions that can occur between the timer trying to
fix ip rules and the ip rules being initially created.

DEV-2458
2019-06-20 14:54:57 -07:00
Nick Huber
3ba97c385f Update usage and method of sending a command to bird
DEV-2446
2019-06-17 09:30:04 -07:00
Nick Huber
364df3a508 Only reconfigure bid on some actions
agg-set-space-bird-config and agg-remove-space-bird-config don't need to
restart all of yap to apply their changes, so just update the files and
reconfigure bird instead to save on some outage time.

DEV-2446
2019-06-14 14:47:46 -07:00
ben
79daa0a1ec Make yap bind to and start after node
This should make YAP run if and only if node is running, which is the
desired behaviour.

This commit also includes making the yap-policy-checker bind to and
start after yap for similar reasons.

DEV-2312
2019-05-24 09:05:44 -07:00
ben
022cf30ada Make yap be 'PartOf' node instead of 'After'
Change yap service dependency type on node from 'After' to 'PartOf'.

DEV-2312
2019-05-23 09:45:53 -07:00
ben
37c9553881 Added IP version and safety-quotes to table grep
DEV-2312
2019-05-23 09:44:12 -07:00
ben
474f5f07c1 Wait for space-specific table in bird to start yap
DEV-2312
2019-05-17 15:28:14 -07:00
ben
5fa8de0346 Manage sysctl ip forwarding in vxr salt state
DEV-2259
2019-04-17 15:50:59 -07:00
Emily Scoular
21779a7891 Merge pull request #4 in PAR/yap from bugfix/DEV-2250-data-failed-to-compile-for-non-yap-aggregators to master
* commit 'bdd76c9550cd856eab51998acfa94424e53a6890':
  Skip yap states for aggregators without yap key in their pillars. DEV-2250
2019-04-11 10:47:00 -07:00
Emily Scoular
bdd76c9550 Skip yap states for aggregators without yap key in their pillars. DEV-2250 2019-04-11 09:50:44 -07:00
James Oakley
0d8ecfacb7 Add method of setting global ospf interface settings 2019-04-10 14:36:14 -07:00
James Oakley
f32da53b3f Fix global interface check 2019-04-10 14:05:13 -07:00
James Oakley
83d2fee0e1 Fix global start 2019-04-10 14:00:42 -07:00
James Oakley
1b2a4a26c1 Add support for global OSPF on VXRs 2019-04-10 13:54:33 -07:00
Emily Scoular
0f34fd6d00 Fix help text and bird config permissions. 2019-04-05 11:26:56 -07:00
Emily Scoular
68c84fc274 Add support for configuring VLAN IPs and not overwriting custom BIRD protocols. 2019-04-03 16:12:01 -07:00
Emily Scoular
ffa181670a Merge pull request #3 in PAR/yap from bugfix/DEV-2031-yap-service-fails-on-start-of-6.4-aggregator to master
* commit '97b8c07b312d43ed68a9f3dcaf38152a8fad8397':
  Don't run pwanbirdc disable on an empty output from bird. DEV-2031
2019-01-08 13:37:42 -08:00
Brandon Cazander
97b8c07b31 Don't run pwanbirdc disable on an empty output from bird. DEV-2031 2019-01-04 13:29:51 -08:00
Brandon Cazander
b17513de78 Make yap on aggregator's wait until bird is ready before trying to
start. DEV-2032

Also changes the dependency of the yap service to node from the network.
2018-12-31 14:26:53 -08:00
root
40a9a8f0ff Bring up vlan trunks
Allow for static configs under /etc/yap/bird_static
2018-12-07 00:32:56 -08:00
Brandon Cazander
dd48794cbc Disable pwr protocols in bird and fix other shit. 2018-12-05 16:38:59 -08:00
James Oakley
16d0d68072 Initial Commit 2018-11-30 08:39:47 -08:00