62 Commits

Author SHA1 Message Date
Monty Taylor
15663daaf7 Add iptables role
Co-Authored-By: James E. Blair <corvus@inaugust.com>
Change-Id: Id8b347483affd710759f9b225bfadb3ce851333c
Depends-On: https://review.openstack.org/596503
2018-08-27 14:33:32 +00:00
Zuul
18bcfeb5c8 Merge "Don't create "admin" group" 2018-08-24 19:57:29 +00:00
Zuul
fcfacc7e52 Merge "Add system-config-run-base job" 2018-08-24 19:57:27 +00:00
Ian Wienand
114953cbff Don't create "admin" group
According to the Ubuntu 12.04 release notes, up until Ubuntu 11.10
admin access was granted via the "admin" unix group, but was changed
to the "sudo" group to be more consistent with Debian et al.

Remove the now unnecessary group

Modify the install-ansible role to set some directory ownership to
root:root; there didn't seem to be any reason to use admin here.

This means the "users" role is no longer required in the bridge.yaml,
as it is run from the base playbook anyway.

Change-Id: I6a7fdd460fb472f0d3468eb080aebbb010931e11
2018-08-24 08:50:22 -07:00
James E. Blair
19aebca3e7 Add system-config-run-base job
This adds a job which creates a bridge-like node and bootstraps it,
and then runs the base playbook against all of the node types we
use in our control plane.  It uses testinfra to validate the results.

Change-Id: Ibdbaf511bbdaee46e1335f2c83b95ba1553a1d94
Depends-On: https://review.openstack.org/595905
2018-08-24 08:50:01 -07:00
Ian Wienand
1939f3e8ec Move exim role to top-level
Move the exim role to be a "generic" role in the top-level roles/
directory, making it available for use as a Zuul role.

Update the linters jobs to look for roles in the top level

Update the Role documentation to explain what the split in roles is
about.

Change-Id: I6b49d2a4b120141b3c99f5f1e28c410da12d9dc3
2018-08-23 21:34:47 +10:00
Ian Wienand
4402201d56 roles: Add README.rst and lint
These role docs aren't exactly War and Peace, but I think longer term
as we fiddle about making things generic or not and moving them
around, we'll be better off having kept ourselves to writing
*something*.

Add terse README.rst files for all existing roles, and add simple
linter check to ensure new roles get them too.

Change-Id: Ibc836310fb8a45e12c2e31f112d92509ac350413
2018-08-23 21:34:42 +10:00
Ian Wienand
564a17812f playbooks/roles/exim: remove "true" filter plugin
This filter is unsued in the role, remove it.

This allows it to be run under zuul and can be moved into the
top-level role/ directory later.

Change-Id: Ice97f0c3c9f52b6bf9f48c7b16d577e555924034
2018-08-23 14:49:50 +10:00
Ian Wienand
b99c4c6fb0 Generate roles documentation
Since we're building out roles in system-config now, generate
documentation.  We look in roles/* and playbook/roles/* (follow-on
changes will split things up between the two).

Correct the reference names in the exim documentation to avoid
warnings and failure.

This also revealed a single unicode character in the exim readme
(which caused prior versions of zuul-sphinx to barf).  For fun, see if
you can find it!

Depends-On: https://review.openstack.org/#/c/579474/
Change-Id: I243a96bbd6d09560f8aa80b6345b90039422547a
2018-08-23 14:49:50 +10:00
Monty Taylor
de7fbba912
Set path in cron so we can find ansible-playbook
ansible-playbook is in /usr/local/bin which is not in the path in cron.

Change-Id: I633c021936dfbbfdb022aa3d052fe88f32d2ef6a
2018-08-21 16:55:42 -05:00
Monty Taylor
759015f101
Start running puppet cron on bridge.openstack.org
Puppet cron is no longer being run on puppetmaster (yay!) so start
running it in cron from bridge.

Change-Id: Idc579a2660a5450092544c21a2e9e6cb9688e5f9
2018-08-20 18:26:30 -05:00
Zuul
45930d6cb4 Merge "Have ansible retry ssh connections" 2018-08-20 20:41:03 +00:00
Zuul
24c86f1648 Merge "Manage sshd config with ansible" 2018-08-20 20:41:00 +00:00
Zuul
744d7fb737 Merge "Remove infracloud references" 2018-08-20 20:21:40 +00:00
Monty Taylor
f6533076f7
Have ansible retry ssh connections
In zuul's ansible config we add retries=3 to deal with transient issues.
Do the same thing for our production runs.

Change-Id: Ide53bae34e5e622de1fd4741706752e8728da20e
2018-08-20 13:18:21 -05:00
Monty Taylor
eae9a42b4b
Manage sshd config with ansible
We write out a specific sshd config file. Let's do it with ansible.

Change-Id: Ie92b6ec6c8772d31009d1c2a2f7d5558bb38f67a
2018-08-20 11:26:38 -05:00
Monty Taylor
0625c289c8
Remove infracloud references
We don't run a cloud anymore and don't use these. With the cfg
management update effort, it's unlikely we'd use them in the form they
are in even if we did get more hardware and decide to run a cloud again.

Remove them for clarity.

Change-Id: I88f58fc7f2768ad60c5387eb775a340cac2c822a
2018-08-20 11:03:55 -05:00
Zuul
2011113c3f Merge "Install ssh key on bridge.openstack.org" 2018-08-19 16:18:53 +00:00
Monty Taylor
c4b111691b
Install ssh key on bridge.openstack.org
We copied this over from puppetmaster, but let's manage it in ansible.

The key has been renamed in host_vars on bridge.openstack.org already.

Change-Id: Ia102dbe2ae2836880092b8997cb99135f5197b00
2018-08-19 10:26:10 -05:00
Monty Taylor
fee717fcbd
Use is changed instead of | changed
Using tests as filters is going away. Use it as a test.

Change-Id: Icc60395186c950d50e539592dcabc772dda96c8a
2018-08-17 16:05:26 -05:00
Monty Taylor
01a90aadb3
Add loop_control and loop_var to silence a warning
The CentOS tasks run inside of a loop in tasks/main.yaml. That means
that item has been defined in the loop there. While it's currently
working, go ahead and add loop_control.loop_var to remove the clash.

Change-Id: I0e8288c35645945aa9b43fb02c29576c1ad31d7e
2018-08-17 15:47:26 -05:00
Monty Taylor
5f6c56998e
Add skip: true to disable-puppet-agent
We don't need to do anything on RH as services don't start by default
there.

Change-Id: I38daee0b80006711cb0c4c65aed108ac0c5c215a
2018-08-17 15:38:41 -05:00
Monty Taylor
03f52d0bc8
Move ansible log into directory
file: state=touch returns changed every time. Instead, put the log files
into a /var/log/ansible directory.

Change-Id: I086d803f0e532b9da41cb01d4e7d2ed66245dfc1
2018-08-17 12:57:20 -05:00
Monty Taylor
ee622108a5
Remove restricted and multiverse from ubuntu servers
restricted is supported software that is non-free.
multiverse is unsupported software that is non-free.

Use of software from either would be unacceptable on any Infra server,
so remove them from the sources.list files.

While we're in there, clean things up a little bit and add an arm file
for bionic.

Change-Id: I55a3b3d411e8a3496a4e6910baaf72f3c192e9d4
2018-08-17 11:53:52 -05:00
Monty Taylor
5380eb5b6e
Remove purge_apt_sources
This was a setting added for infra cloud that had to do with bootstrap
order. It seems to have been cargo-culted elsewhere. Remove it. Let's be
specific with our sources.list files.

Change-Id: Iefbd59ad20e9fdc450d9a0c4e58b9cf4a89ff5a3
2018-08-17 11:53:52 -05:00
Monty Taylor
03d09b777e
Use openstack and groups inventory from system-config
Rather than copying these out of system-config inside of
install-ansible, just point the ansible.cfg to them in the system-config
location. This way as changes come in that have group updates we don't
have to first apply them to the system.

Change-Id: I1cefd7848b7f3f1adc8fbfa080eb9831124a297b
2018-08-17 11:47:13 -05:00
Monty Taylor
1a8c2f66da
Move /opt/system-config/production to /opt/system-config
The production directory is a relic from the puppet environment concept,
which we do not use. Remove it.

The puppet apply tests run puppet locally, where the production
environment is still needed, so don't update the paths in the
tools/prep-apply.sh.

Depends-On: https://review.openstack.org/592946
Change-Id: I82572cc616e3c994eab38b0de8c3c72cb5ec5413
2018-08-17 09:41:02 -05:00
Monty Taylor
c4ae268492
Turn on fact caching
We do this for zuul jobs already, so let's do it for our production
runs.

Shift the inventory cache location down a directory so that launch-node
can invalidate the inventory cache.

Change-Id: I52b1c48d091c07e4205c1a7233448925ca26d8d3
2018-08-17 05:44:37 -05:00
Zuul
f3036203c3 Merge "Remove base.yaml things from openstack_project::server" 2018-08-17 10:43:53 +00:00
Monty Taylor
bab6fcad3c
Remove base.yaml things from openstack_project::server
Now that we've got base server stuff rewritten in ansible, remove the
old puppet versions.

Depends-On: https://review.openstack.org/588326
Change-Id: I5c82fe6fd25b9ddaa77747db377ffa7e8bf23c7b
2018-08-16 17:25:10 -05:00
Zuul
ab84adf4bb Merge "Template all exim routers" 2018-08-16 22:19:35 +00:00
Zuul
1463a78fc0 Merge "Make a firehose group with firehose01 in it" 2018-08-16 21:20:46 +00:00
James E. Blair
40c6e6d7ad Template all exim routers
So that we can have complete control of the router order, always
template the full set of routers, including the "default" ones.
So that it's easy to use the defaults but put them in a different
order, define each router in its own variable which can be used
in host or group vars to "copy" that router in.

Apply this change to lists, firehose, and storyboard, all of which
have custom exim routers.  Note that firehose intentionally has
its localuser router last.

Change-Id: I737942b8c15f7020b54e350db885e968a93f806a
2018-08-16 13:49:55 -07:00
Monty Taylor
f78f871afe
Make a firehose group with firehose01 in it
We want to configure firehose logically as the firehose service, but the
host that is in the group is called firehose01.openstack.org. Make a
group and put the config variables for firehose into it.

Change-Id: I17c8e8a72f41c5e2730af81f70cef81dd3ed7bca
2018-08-16 15:11:20 -05:00
Zuul
40fec4c885 Merge "Use jinja match filter instead of regex_match" 2018-08-16 20:10:02 +00:00
Monty Taylor
3e139891be
Use jinja match filter instead of regex_match
regex_match seems to either not work or not exist or something. match,
otoh, works. Additionally, we get this:

  [DEPRECATION WARNING]: Using tests as filters is deprecated. Instead
   of using `result|match` use `result is match`. This feature will
   be removed in version 2.9.

when using the | syntax, so obey the warning and switch to is.

Change-Id: Ie201241a11c08b9fed58c0e1790e8187ee4cf474
2018-08-16 14:26:17 -05:00
Zuul
3b0dc9df7c Merge "Stop running puppet from puppetmaster" 2018-08-16 16:40:29 +00:00
Zuul
6c6275a4af Merge "Add exim config for firehose and storyboard" 2018-08-16 16:40:27 +00:00
Zuul
6e329d479e Merge "Add lists exim config to ansible" 2018-08-16 16:40:25 +00:00
Zuul
c5559d3636 Merge "Add ssh pipelining config for ansible" 2018-08-15 22:58:32 +00:00
Zuul
80f0fcc785 Merge "Remove bridge from disabled and add puppet group" 2018-08-15 22:58:31 +00:00
Monty Taylor
33c0756ff8
Stop running puppet from puppetmaster
Bridge can run puppet on the remote hosts. Stop running on puppetmaster
so that we can run from bridge. Put it in the disabled group so that we
don't try to run puppet on it from bridge.

Change-Id: Ibcfa7e902c07c55e3a84f8232a11792c5f7d80e9
2018-08-15 15:11:48 -05:00
Monty Taylor
0d1f235fce
Add exim config for firehose and storyboard
In order to get puppet out of the business of mucking with exim and
fighting ansible, finish moving the config to ansible.

This introduces a storyboard group that we can use to apply the exim
config across both servers. It also splits the base playbook so that we
can avoid running exim on the backup servers. And we set
purge_apt_sources the same as was set in puppet. We should probably
remove it though, since none of us have any clue why it's here.

Change-Id: I43ee891a9c1beead7f97808208829b01a0a7ced6
2018-08-15 15:11:48 -05:00
Monty Taylor
4cca3f8d2a
Add lists exim config to ansible
The mailing list servers have a more complex exim config. Put the
routers and transports into ansible variables.

While we're doing it, role variables with an exim_ prefix - since 'routers'
as a global variable might be a little broad.

iteritems isn't a thing in python3, only items.

We need to escape the exim config with ${if or{{ - because of the {{
which looks like jinja. Wrap it in a {% raw %} block.

Getting the yaml indentation right for things here is non-trivial. Make
them strings instead.

Add a README.rst file - and use the zuul:rolevar construct in it,
because it's nice.

Change-Id: Ieccfce99a1d278440c5baa207479a1887898298e
2018-08-15 15:11:48 -05:00
Monty Taylor
4c400cfa7d
Add ssh pipelining config for ansible
Now that we're running more than just "puppet apply", reconnecting
starts to add up. Turn on pipelining.

Change-Id: If629485a0e602f1a906fef0cabd73154243d7e3d
2018-08-15 15:11:43 -05:00
Monty Taylor
245609bc95
Remove bridge from disabled and add puppet group
Instead of just having bridge be disabled, make a puppet group that it's
not a part of and switch the remote_puppet_else playbook to use that.

Change-Id: Ifb96ce483fc5675d095723bda70242a425bdc619
2018-08-15 08:43:23 -05:00
Monty Taylor
102369320f Add system-config to roles path
This is a setup for the next patch, to allow us to roll the change out.

Update the roles path to point to the system-config roles dir.

Change-Id: I6bcf36beba8e65c9dd8ddf9f4a99d0308f42c565
2018-08-14 19:38:07 +00:00
Monty Taylor
a4a134815c
Add exim role to base playbook
We want email to work.

Add a default value so that integration tests work - and update the
template so that if the value in the alias mapping is empty we don't
write out a half-formed alias.

Enable the epel repo on CentOS nodes in base-repos. This is done in
install_puppet.sh, but install_puppet.sh doesn't get run on ansible-only
nodes.

Change-Id: I68ad9f66c3b8672d9642c7764e50adac9cafdaf9
2018-08-13 09:20:36 -05:00
Monty Taylor
d587307aaf
Make integration tests works
Split base playbook into two plays

The update apt-cache handler from base-repos needs to fire before we run
base-server. Split into two plays so that the handler will fire.

Fix use of first_found

For include_vars, using the lookup version of first_found requires being
explicit about the path to search in as well. We also need to use query
together with loop to get skip to work right.

Extract the list of file locations we look for for distro and platform
specific variables into a variable so that we can reuse it instead of
copy-pasta.

The vim package is vim-nox on ubuntu and vim-minimal on debian.

ntpdate only needs to be enabled on boot, it does not need to be
immediately started. At least, that's what the old puppet was doing and
trying to start it immediately breaks centos integration tests.

emacs-nox is emacs23-nox on trusty.

Change-Id: If3db276a5f6a8f76d7ce8635da8d2cbc316af341
Depends-On: https://review.openstack.org/588326
2018-08-10 12:12:32 -05:00
Monty Taylor
57ee42601a
Replace with_first_found with lookup first_found
The with_ directives are discouraged now in place of use of loop: and/or
lookup filters. In the case of with_first_found, it confuses people
because with_ directives are usually a loop, but in this case it's
the task is always executed once. Using the first_found filter makes it
clearer that this is occuring.

While we're in there, remove uses of 'static: no'. Since 2.0 includes
are dynamic by default, so these are not necessary.

Change-Id: Ie429d7614b2f3322a646f46a8117d4b6ae29f737
2018-08-03 09:05:13 -05:00