From 2814233822a1579c86247603a030826cbf6798c5 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Thu, 18 Dec 2014 17:05:50 +0100 Subject: [PATCH] Initial import --- AUTHORS | 1 + COPYING | 339 ++++++++++++++++++ README.md | 228 ++++++++++++ roles/ansible-base/tasks/main.yml | 39 ++ roles/apache2-php5/handlers/main.yml | 7 + roles/apache2-php5/meta/main.yml | 5 + roles/apache2-php5/tasks/main.yml | 30 ++ roles/autofs/handlers/main.yml | 7 + roles/autofs/meta/main.yml | 5 + roles/autofs/tasks/main.yml | 39 ++ roles/autofs/templates/net.autofs.j2 | 6 + roles/debian-base/tasks/main.yml | 79 ++++ roles/git-backup-script/handlers/main.yml | 11 + roles/git-backup-script/meta/main.yml | 5 + roles/git-backup-script/tasks/main.yml | 22 ++ roles/git-configscripts/defaults/main.yml | 4 + roles/git-configscripts/handlers/main.yml | 20 ++ roles/git-configscripts/meta/main.yml | 5 + roles/git-configscripts/tasks/main.yml | 15 + roles/git-nagcollect/defaults/main.yml | 11 + roles/git-nagcollect/handlers/main.yml | 11 + roles/git-nagcollect/meta/main.yml | 5 + roles/git-nagcollect/tasks/main.yml | 38 ++ .../templates/nagcollect.conf.j2 | 17 + .../templates/nagcollect.cron.j2 | 6 + roles/lcmc-cluster-node/meta/main.yml | 7 + roles/lcmc-cluster-node/tasks/main.yml | 13 + roles/mysql-server/defaults/main.yml | 8 + roles/mysql-server/meta/main.yml | 5 + roles/mysql-server/tasks/main.yml | 121 +++++++ roles/net-base/tasks/main.yml | 9 + roles/nfs-client/defaults/main.yml | 4 + roles/nfs-client/handlers/main.yml | 7 + roles/nfs-client/meta/main.yml | 5 + roles/nfs-client/tasks/main.yml | 31 ++ roles/nfs-client/templates/idmapd.conf.j2 | 13 + roles/ntpd/handlers/main.yml | 7 + roles/ntpd/meta/main.yml | 5 + roles/ntpd/tasks/main.yml | 34 ++ roles/ntpd/templates/ntp.conf | 22 ++ roles/postfix/handlers/main.yml | 7 + roles/postfix/meta/main.yml | 5 + roles/postfix/tasks/main.yml | 84 +++++ roles/postfix/templates/mailname.j2 | 1 + roles/sshd/meta/main.yml | 5 + roles/sshd/tasks/main.yml | 22 ++ 46 files changed, 1370 insertions(+) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 README.md create mode 100644 roles/ansible-base/tasks/main.yml create mode 100644 roles/apache2-php5/handlers/main.yml create mode 100644 roles/apache2-php5/meta/main.yml create mode 100644 roles/apache2-php5/tasks/main.yml create mode 100644 roles/autofs/handlers/main.yml create mode 100644 roles/autofs/meta/main.yml create mode 100644 roles/autofs/tasks/main.yml create mode 100644 roles/autofs/templates/net.autofs.j2 create mode 100644 roles/debian-base/tasks/main.yml create mode 100644 roles/git-backup-script/handlers/main.yml create mode 100644 roles/git-backup-script/meta/main.yml create mode 100644 roles/git-backup-script/tasks/main.yml create mode 100644 roles/git-configscripts/defaults/main.yml create mode 100644 roles/git-configscripts/handlers/main.yml create mode 100644 roles/git-configscripts/meta/main.yml create mode 100644 roles/git-configscripts/tasks/main.yml create mode 100644 roles/git-nagcollect/defaults/main.yml create mode 100644 roles/git-nagcollect/handlers/main.yml create mode 100644 roles/git-nagcollect/meta/main.yml create mode 100644 roles/git-nagcollect/tasks/main.yml create mode 100644 roles/git-nagcollect/templates/nagcollect.conf.j2 create mode 100644 roles/git-nagcollect/templates/nagcollect.cron.j2 create mode 100644 roles/lcmc-cluster-node/meta/main.yml create mode 100644 roles/lcmc-cluster-node/tasks/main.yml create mode 100644 roles/mysql-server/defaults/main.yml create mode 100644 roles/mysql-server/meta/main.yml create mode 100644 roles/mysql-server/tasks/main.yml create mode 100644 roles/net-base/tasks/main.yml create mode 100644 roles/nfs-client/defaults/main.yml create mode 100644 roles/nfs-client/handlers/main.yml create mode 100644 roles/nfs-client/meta/main.yml create mode 100644 roles/nfs-client/tasks/main.yml create mode 100644 roles/nfs-client/templates/idmapd.conf.j2 create mode 100644 roles/ntpd/handlers/main.yml create mode 100644 roles/ntpd/meta/main.yml create mode 100644 roles/ntpd/tasks/main.yml create mode 100644 roles/ntpd/templates/ntp.conf create mode 100644 roles/postfix/handlers/main.yml create mode 100644 roles/postfix/meta/main.yml create mode 100644 roles/postfix/tasks/main.yml create mode 100644 roles/postfix/templates/mailname.j2 create mode 100644 roles/sshd/meta/main.yml create mode 100644 roles/sshd/tasks/main.yml diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..9ebacba --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +Alexander Barton diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d524d6c --- /dev/null +++ b/README.md @@ -0,0 +1,228 @@ +# Alex' Ansible Roles Repository + +This repository contains Ansible roles that are targeted for Debian +GNU/Linux version 7 (Wheezy) systems. + + +## Available Roles + + +### ansible-base + +Configure the target system to be managed by Ansible, update *logcheck(8)* +configuration, for example. + + +### apache2-php5 + +Default Apache 2.x setup with PHP 5.x. + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - apache2-mpm-prefork + - apache2-utils + - apachetop + - libapache2-mod-php5 + - php-apc + - php5 + - php5-cli + - php5-mysql + + +### autofs + +NFS "automounter" (autofs) setup including `/net/hostname` pseudo +directory hierarchy. + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - autofs + + +### debian-base + +Basic Debian setup, including APT and Debconf configuration as well as a +set of standard packages. + +#### Installed Packages + + - bash-completion + - busybox-static + - ca-certificates + - curl + - debconf-utils + - etckeeper + - git + - htop + - less + - linux-image-amd64 + - lsb-base + - lsb-release + - psmisc + - net-tools + - screen + - sudo + - telnet-ssl + - vim + + +### git-backup-script + +Local "BackupScript" installation from the GIT repository of Alex +(see https://arthur.barton.de/cgi-bin/gitweb.cgi?p=backup-script.git). + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - rsync + + +### git-configscripts + +Local "ConfigScripts" installation from the GIT repository of Alex +(see https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ConfigScripts.git). + +#### Depends on / Pulls in + + - debian-base + +#### Variables + + - `git_configscripts_users`: List of existing users to update. + + +### git-nagcollect + +Local "NagCollect" client installation from the GIT repository of Alex +(see https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git). + +#### Depends on / Pulls in + + - debian-base + +#### Variables + + - `nagcollect_server_url`: Server URL. + - `nagcollect_client_key`: Client key ("password"). + - `nagcollect_client_id`: Client (host) identifier. + + +### lcmc-cluster-node + +Setup for Linux clusters running DRBD, Pacemaker, and Corosync using the +"Linux Cluster Management Console" (LCMC, see http://lcmc.sourceforge.net). + +#### Depends on / Pulls in + + - debian-base + - sshd + - ntpd + +#### Installed Packages + + - drbd8-utils + - pacemaker + - corosync + + +### mysql-server + +MySQL Server setup, including a separate LVM data partition, if desired. + +#### Depends on / Pulls in + + - debian-base + +#### Variables + + - `mysql_server_vg`: LVM volume group name. + - `mysql_server_ansible_user`: MySQL management user. Default "ansible". + - `mysql_server_ansible_password`: Password of management user. Default "ansible". + - `mysql_server_root_host`: Hostname for MySQL "root" user. Default "localhost". + - `mysql_server_root_password`: Password for the MySQL "root" user. + +#### Installed Packages + + - mysql-client + - mysql-server + - mysqltuner + - python-mysqldb + + +### net-base + +Basic networking configuration, including the target hostname which is set +to the Ansible inventory hostname. + + +### nfs-client + +NFS client setup. + +#### Depends on / Pulls in + + - debian-base + +#### Variables + + - `nfs_client_domain`: NFSv4 client domain. Default: `ansible_domain`. + +#### Installed Packages + + - nfs-common + + +### ntpd + +Local *ntpd(8)* setup. + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - ntpdate + - ntp + + +### postfix + +Postfix SMTP server setup. + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - postfix + + +### sshd + +SSH daemon setup. + +Please note that this role always updates the SSH packages to the latest +version and not only makes sure that a "ssh" package is installed, like most +other roles in this repository. + +#### Depends on / Pulls in + + - debian-base + +#### Installed Packages + + - openssh-blacklist-extra + - ssh diff --git a/roles/ansible-base/tasks/main.yml b/roles/ansible-base/tasks/main.yml new file mode 100644 index 0000000..7758472 --- /dev/null +++ b/roles/ansible-base/tasks/main.yml @@ -0,0 +1,39 @@ +--- +# ansible-base task + +- name: prepare logcheck directory structure + tags: + - logcheck + file: > + mode=755 + path=/etc/logcheck/ignore.d.paranoid + state=directory + +# setup logcheck configuration. But note that package "logcheck" probably +# isn't installed at all, so we can't use the "logcheck" group! + +- name: logcheck(8) configuration for Ansible tools + tags: + - ansible + - logcheck + lineinfile: > + create=yes + dest=/etc/logcheck/ignore.d.paranoid/local-ansible + group=root + line='^\w{3} [ :0-9]{11} [._[:alnum:]-]+ ansible-[[:alnum:]]+:' + mode=644 + owner=root + state=present + +- name: logcheck(8) configuration for SFTP requests of Ansible + tags: + - ansible + - logcheck + lineinfile: > + create=yes + dest=/etc/logcheck/ignore.d.paranoid/local-ansible + group=root + line='^\w{3} [ :0-9]{11} [._[:alnum:]-]+ sshd\[[0-9]+\]: subsystem request for sftp by user root' + mode=644 + owner=root + state=present diff --git a/roles/apache2-php5/handlers/main.yml b/roles/apache2-php5/handlers/main.yml new file mode 100644 index 0000000..00b3e58 --- /dev/null +++ b/roles/apache2-php5/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# apache2-php5 handlers + +- name: restart "apache2" + service: > + name=apache2 + state=restarted diff --git a/roles/apache2-php5/meta/main.yml b/roles/apache2-php5/meta/main.yml new file mode 100644 index 0000000..48822fb --- /dev/null +++ b/roles/apache2-php5/meta/main.yml @@ -0,0 +1,5 @@ +--- +# apache2-php5 meta + +dependencies: + - { role: debian-base } diff --git a/roles/apache2-php5/tasks/main.yml b/roles/apache2-php5/tasks/main.yml new file mode 100644 index 0000000..aead05e --- /dev/null +++ b/roles/apache2-php5/tasks/main.yml @@ -0,0 +1,30 @@ +--- +# apache2-php5 tasks + +- name: install packages for Apache 2 with PHP 5 + tags: + - apache + - packages + apt: > + state=installed + name={{ item }} + with_items: + - apache2-mpm-prefork + - apache2-utils + - apachetop + - libapache2-mod-php5 + - php-apc + - php5 + - php5-cli + - php5-mysql + notify: + - restart "apache2" + +- name: ensure service "apache2" is enabled and running + tags: + - apache + - services + service: > + enabled=yes + name=autofs + state=running diff --git a/roles/autofs/handlers/main.yml b/roles/autofs/handlers/main.yml new file mode 100644 index 0000000..1aeb35c --- /dev/null +++ b/roles/autofs/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# autofs handlers + +- name: restart "autofs" + service: > + name=autofs + state=restarted diff --git a/roles/autofs/meta/main.yml b/roles/autofs/meta/main.yml new file mode 100644 index 0000000..233305e --- /dev/null +++ b/roles/autofs/meta/main.yml @@ -0,0 +1,5 @@ +--- +# autofs meta + +dependencies: + - { role: debian-base } diff --git a/roles/autofs/tasks/main.yml b/roles/autofs/tasks/main.yml new file mode 100644 index 0000000..d903ba3 --- /dev/null +++ b/roles/autofs/tasks/main.yml @@ -0,0 +1,39 @@ +--- +# autofs tasks + +- name: prepare autofs(8) directory structure + tags: + - autofs + file: > + mode=755 + path=/etc/auto.master.d/ + state=directory + +- name: /etc/auto.master.d/net.autofs file + tags: + - autofs + template: > + dest=/etc/auto.master.d/net.autofs + group=root + mode=644 + owner=root + src=net.autofs.j2 + notify: + - restart "autofs" + +- name: install "autofs" + tags: + - autofs + - packages + apt: > + name=autofs + state=installed + +- name: ensure service "autofs" is enabled and running + tags: + - autofs + - services + service: > + enabled=yes + name=autofs + state=running diff --git a/roles/autofs/templates/net.autofs.j2 b/roles/autofs/templates/net.autofs.j2 new file mode 100644 index 0000000..c19459a --- /dev/null +++ b/roles/autofs/templates/net.autofs.j2 @@ -0,0 +1,6 @@ +# /etc/auto.master.d/net.autofs - autofs(8) configuration for "/net" +# --- +# {{ ansible_managed }} +# --- + +/net -hosts soft diff --git a/roles/debian-base/tasks/main.yml b/roles/debian-base/tasks/main.yml new file mode 100644 index 0000000..326bb6c --- /dev/null +++ b/roles/debian-base/tasks/main.yml @@ -0,0 +1,79 @@ +--- +# debian-base tasks + +- name: 'apt(8): Disable "package diffs"' + tags: + - apt + - packages + lineinfile: > + create=yes + dest=/etc/apt/apt.conf + group=root + line='Acquire::PDiffs "false";' + mode=644 + owner=root + +- name: "aptitude(8): Don't install recommended packages by default" + tags: + - apt + - packages + lineinfile: > + create=yes + dest=/root/.aptitude/config + group=root + line='Apt::Install-Recommends "false";' + owner=root + +- name: update APT repositories (when outdated) + tags: + - apt + - packages + apt: > + update_cache=yes + cache_valid_time=3600 + +- name: configure debconf(1) frontend + tags: + - debconf + - packages + debconf: > + name=debconf + question=debconf/frontend + value=Dialog + vtype=select + +- name: configure debconf(1) priority + tags: + - debconf + - packages + debconf: > + name=debconf + question=debconf/priority + value=low + vtype=select + +- name: install common packages + tags: + - packages + apt: > + state=installed + name={{ item }} + with_items: + - bash-completion + - busybox-static + - ca-certificates + - curl + - debconf-utils + - etckeeper + - git + - htop + - less + - linux-image-amd64 + - lsb-base + - lsb-release + - psmisc + - net-tools + - screen + - sudo + - telnet-ssl + - vim diff --git a/roles/git-backup-script/handlers/main.yml b/roles/git-backup-script/handlers/main.yml new file mode 100644 index 0000000..d5be708 --- /dev/null +++ b/roles/git-backup-script/handlers/main.yml @@ -0,0 +1,11 @@ +--- +# git-backup-script handlers + +- name: install "backup-script" + tags: + - git + - source + - backup + shell: make install + args: + chdir: /usr/local/src/backup-script diff --git a/roles/git-backup-script/meta/main.yml b/roles/git-backup-script/meta/main.yml new file mode 100644 index 0000000..faac37b --- /dev/null +++ b/roles/git-backup-script/meta/main.yml @@ -0,0 +1,5 @@ +--- +# git-backup-scripts meta + +dependencies: + - { role: debian-base } diff --git a/roles/git-backup-script/tasks/main.yml b/roles/git-backup-script/tasks/main.yml new file mode 100644 index 0000000..77f39c4 --- /dev/null +++ b/roles/git-backup-script/tasks/main.yml @@ -0,0 +1,22 @@ +--- +# git-backup-script + +- name: install "rsync" + tags: + - packages + apt: > + state=installed + name=rsync + +- name: clone "backup-script" GIT repository + tags: + - git + - source + - backup + git: > + accept_hostkey=True + dest=/usr/local/src/backup-script + repo="git://arthur.barton.de/backup-script.git" + update=yes + notify: + - install "backup-script" diff --git a/roles/git-configscripts/defaults/main.yml b/roles/git-configscripts/defaults/main.yml new file mode 100644 index 0000000..ce35eb9 --- /dev/null +++ b/roles/git-configscripts/defaults/main.yml @@ -0,0 +1,4 @@ +--- +# git-configscripts defaults + +git_configscripts_users: "" diff --git a/roles/git-configscripts/handlers/main.yml b/roles/git-configscripts/handlers/main.yml new file mode 100644 index 0000000..c9d184d --- /dev/null +++ b/roles/git-configscripts/handlers/main.yml @@ -0,0 +1,20 @@ +--- +# git-configscripts handlers + +- name: install "ConfigScripts" for "root" and system + tags: + - git + - source + shell: make install + args: + chdir: /usr/local/src/ConfigScripts + +- name: install "ConfigScripts" for users + tags: + - git + - source + shell: su {{ item }} -c "make install" + args: + chdir: /usr/local/src/ConfigScripts + with_items: git_configscripts_users + when: item != "" diff --git a/roles/git-configscripts/meta/main.yml b/roles/git-configscripts/meta/main.yml new file mode 100644 index 0000000..4d25b42 --- /dev/null +++ b/roles/git-configscripts/meta/main.yml @@ -0,0 +1,5 @@ +--- +# git-configscripts meta + +dependencies: + - { role: debian-base } diff --git a/roles/git-configscripts/tasks/main.yml b/roles/git-configscripts/tasks/main.yml new file mode 100644 index 0000000..3badbc4 --- /dev/null +++ b/roles/git-configscripts/tasks/main.yml @@ -0,0 +1,15 @@ +--- +# git-configscripts + +- name: clone "ConfigScripts" GIT repository + tags: + - git + - source + git: > + accept_hostkey=True + dest=/usr/local/src/ConfigScripts + repo="git://arthur.barton.de/ConfigScripts.git" + update=yes + notify: + - install "ConfigScripts" for "root" and system + - install "ConfigScripts" for users diff --git a/roles/git-nagcollect/defaults/main.yml b/roles/git-nagcollect/defaults/main.yml new file mode 100644 index 0000000..f3fb828 --- /dev/null +++ b/roles/git-nagcollect/defaults/main.yml @@ -0,0 +1,11 @@ +--- +# git-nagcollect: defaults + +# Server URL +nagcollect_server_url: "" + +# Client key ("password") +nagcollect_client_key: "" + +# Client (host) identifier +nagcollect_client_id: "" diff --git a/roles/git-nagcollect/handlers/main.yml b/roles/git-nagcollect/handlers/main.yml new file mode 100644 index 0000000..e9b739d --- /dev/null +++ b/roles/git-nagcollect/handlers/main.yml @@ -0,0 +1,11 @@ +--- +# git-nagcollect handlers + +- name: install "NagCollect" client + tags: + - git + - source + - monitoring + shell: make install-client + args: + chdir: /usr/local/src/NagCollect diff --git a/roles/git-nagcollect/meta/main.yml b/roles/git-nagcollect/meta/main.yml new file mode 100644 index 0000000..e7982e0 --- /dev/null +++ b/roles/git-nagcollect/meta/main.yml @@ -0,0 +1,5 @@ +--- +# git-nagcollect meta + +dependencies: + - { role: debian-base } diff --git a/roles/git-nagcollect/tasks/main.yml b/roles/git-nagcollect/tasks/main.yml new file mode 100644 index 0000000..07936ee --- /dev/null +++ b/roles/git-nagcollect/tasks/main.yml @@ -0,0 +1,38 @@ +--- +# git-nagcollect tasks + +- name: setup "NagCollect" configuration + tags: + - monitoring + template: > + dest=/usr/local/etc/nagcollect.conf + group=root + mode=600 + owner=root + src=nagcollect.conf.j2 + when: nagcollect_server_url != "" and nagcollect_client_key != "" and nagcollect_client_id != "" + +- name: clone "NagCollect" GIT repository + tags: + - git + - source + - monitoring + git: > + accept_hostkey=True + dest=/usr/local/src/NagCollect + repo="git://arthur.barton.de/nagcollect.git" + update=yes + notify: + - install "NagCollect" client + when: nagcollect_server_url != "" and nagcollect_client_key != "" and nagcollect_client_id != "" + +- name: setup "NagCollect" to run periodically + tags: + - monitoring + template: > + dest=/etc/cron.d/nagcollect + group=root + mode=644 + owner=root + src=nagcollect.cron.j2 + when: nagcollect_server_url != "" and nagcollect_client_key != "" and nagcollect_client_id != "" diff --git a/roles/git-nagcollect/templates/nagcollect.conf.j2 b/roles/git-nagcollect/templates/nagcollect.conf.j2 new file mode 100644 index 0000000..cc33a49 --- /dev/null +++ b/roles/git-nagcollect/templates/nagcollect.conf.j2 @@ -0,0 +1,17 @@ +# /usr/local/etc/nagcollect.conf +# Configuration file read by NagCollect tools +# --- +# {{ ansible_managed }} +# --- + +# HTTP[s] URL of the NagCollect server, including the trailing '/': +SERVER_URL="{{ nagcollect_server_url }}" + +# Client key as configured on the server +CLIENT_KEY="{{ nagcollect_client_key }}" + +# Client ID to use in Nagios, must be unique! +CLIENT_ID="{{ nagcollect_client_id }}" + +# Auto-update local test scripts? [1=yes] +AUTOUPDATE=1 diff --git a/roles/git-nagcollect/templates/nagcollect.cron.j2 b/roles/git-nagcollect/templates/nagcollect.cron.j2 new file mode 100644 index 0000000..ac41cd0 --- /dev/null +++ b/roles/git-nagcollect/templates/nagcollect.cron.j2 @@ -0,0 +1,6 @@ +# /etc/cron.d/nagcollect +# --- +# {{ ansible_managed }} +# --- + +*/15 * * * * root /usr/local/sbin/nagcollect >/dev/null diff --git a/roles/lcmc-cluster-node/meta/main.yml b/roles/lcmc-cluster-node/meta/main.yml new file mode 100644 index 0000000..a940e95 --- /dev/null +++ b/roles/lcmc-cluster-node/meta/main.yml @@ -0,0 +1,7 @@ +--- +# lcmc-cluster-node meta + +dependencies: + - { role: debian-base } + - { role: sshd } + - { role: ntpd } diff --git a/roles/lcmc-cluster-node/tasks/main.yml b/roles/lcmc-cluster-node/tasks/main.yml new file mode 100644 index 0000000..3788f00 --- /dev/null +++ b/roles/lcmc-cluster-node/tasks/main.yml @@ -0,0 +1,13 @@ +--- +# lcmc-cluster-node tasks + +- name: install packages for cluster nodes + tags: + - packages + apt: > + state=installed + name={{ item }} + with_items: + - drbd8-utils + - pacemaker + - corosync diff --git a/roles/mysql-server/defaults/main.yml b/roles/mysql-server/defaults/main.yml new file mode 100644 index 0000000..e077b4a --- /dev/null +++ b/roles/mysql-server/defaults/main.yml @@ -0,0 +1,8 @@ +--- +# mysql-server: defaults + +mysql_server_vg: "" +mysql_server_ansible_user: "ansible" +mysql_server_ansible_password: "ansible" +mysql_server_root_host: "localhost" +mysql_server_root_password: "" diff --git a/roles/mysql-server/meta/main.yml b/roles/mysql-server/meta/main.yml new file mode 100644 index 0000000..a83b894 --- /dev/null +++ b/roles/mysql-server/meta/main.yml @@ -0,0 +1,5 @@ +--- +# mysql-server meta + +dependencies: + - { role: debian-base } diff --git a/roles/mysql-server/tasks/main.yml b/roles/mysql-server/tasks/main.yml new file mode 100644 index 0000000..645a32c --- /dev/null +++ b/roles/mysql-server/tasks/main.yml @@ -0,0 +1,121 @@ +--- +# mysql-server tasks + +- name: check if MySQL data already exists + tags: + - mysql + - fs + shell: test -d /var/lib/mysql/mysql + ignore_errors: yes + register: mysql_server_installed + changed_when: false + +- name: setup LVM volume "mysql" for MySQL + tags: + - mysql + - partition + - lvm + - fs + lvol: > + lv=mysql + size=10g + vg={{ mysql_server_vg }} + when: mysql_server_vg != "" and mysql_server_installed.rc != 0 + +- name: create ext4 filesystem on MySQL partition "mysql" + tags: + - mysql + - fs + filesystem: > + dev=/dev/{{ mysql_server_vg }}/mysql + fstype=ext4 + opts="-L mysql" + when: mysql_server_vg != "" and mysql_server_installed.rc != 0 + +- name: create mount point "/var/lib/mysql" + tags: + - mysql + - fs + file: > + path=/var/lib/mysql + state=directory + when: mysql_server_vg != "" and mysql_server_installed.rc != 0 + +- name: configure and mount MySQL partition "mysql" + tags: + - mysql + - fs + - mount + mount: > + fstype=ext4 + name=/var/lib/mysql + src=/dev/{{ mysql_server_vg }}/mysql + state=mounted + opts=rw,errors=remount-ro,noatime + passno=2 + when: mysql_server_vg != "" and mysql_server_installed.rc != 0 + +- name: install MySQL packages for client and server + tags: + - mysql + - packages + apt: > + state=installed + name={{ item }} + with_items: + - mysql-client + - mysql-server + - mysqltuner + - python-mysqldb + +- name: ensure service "mysql" is enabled and running + tags: + - services + - mysql + service: > + enabled=yes + name=mysql + state=running + +- name: setup MySQL "ansible" account + tags: + - mysql + - mysql-users + mysql_user: > + login_user={{ mysql_server_ansible_user }} + login_password={{ mysql_server_ansible_password }} + check_implicit_admin=yes + host="localhost" + name=ansible + password={{ mysql_server_ansible_password }} + priv="*.*:ALL,GRANT" + state=present + +- name: setup MySQL "root" account + tags: + - mysql + - mysql-users + mysql_user: > + login_user={{ mysql_server_ansible_user }} + login_password={{ mysql_server_ansible_password }} + host="{{ mysql_server_root_host }}" + name=root + password={{ mysql_server_root_password }} + priv="*.*:ALL,GRANT" + state=present + +- name: Remove unwanted MySQL "root" accounts + tags: + - mysql + - mysql-users + mysql_user: > + login_user={{ mysql_server_ansible_user }} + login_password={{ mysql_server_ansible_password }} + host={{ item }} + name=root + state=absent + with_items: + - "{{ ansible_hostname }}" + - "localhost" + - "127.0.0.1" + - "::1" diff --git a/roles/net-base/tasks/main.yml b/roles/net-base/tasks/main.yml new file mode 100644 index 0000000..d3d959c --- /dev/null +++ b/roles/net-base/tasks/main.yml @@ -0,0 +1,9 @@ +--- +# net-base tasks + +- name: configure hostname + tags: + - networking + - hostname + hostname: > + name="{{ inventory_hostname_short }}" diff --git a/roles/nfs-client/defaults/main.yml b/roles/nfs-client/defaults/main.yml new file mode 100644 index 0000000..199bc5f --- /dev/null +++ b/roles/nfs-client/defaults/main.yml @@ -0,0 +1,4 @@ +--- +# nfs-client defaults + +nfs_client_domain: "{{ ansible_domain }}" diff --git a/roles/nfs-client/handlers/main.yml b/roles/nfs-client/handlers/main.yml new file mode 100644 index 0000000..bb3d6ed --- /dev/null +++ b/roles/nfs-client/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# nfs-client handlers + +- name: restart "nfs-common" + service: > + name=nfs-common + state=restarted diff --git a/roles/nfs-client/meta/main.yml b/roles/nfs-client/meta/main.yml new file mode 100644 index 0000000..4eaf4ee --- /dev/null +++ b/roles/nfs-client/meta/main.yml @@ -0,0 +1,5 @@ +--- +# nfs-client meta + +dependencies: + - { role: debian-base } diff --git a/roles/nfs-client/tasks/main.yml b/roles/nfs-client/tasks/main.yml new file mode 100644 index 0000000..949c2e2 --- /dev/null +++ b/roles/nfs-client/tasks/main.yml @@ -0,0 +1,31 @@ +--- +# nfs-client tasks + +- name: /etc/idmapd.conf file + tags: + - nfs + template: > + dest=/etc/idmapd.conf + group=root + mode=644 + owner=root + src=idmapd.conf.j2 + notify: + - restart "nfs-common" + +- name: install "nfs-common" + tags: + - nfs + - packages + apt: > + name=nfs-common + state=installed + +- name: ensure service "nfs-common" is enabled and running + tags: + - nfs + - services + service: > + enabled=yes + name=nfs-common + state=running diff --git a/roles/nfs-client/templates/idmapd.conf.j2 b/roles/nfs-client/templates/idmapd.conf.j2 new file mode 100644 index 0000000..92415c6 --- /dev/null +++ b/roles/nfs-client/templates/idmapd.conf.j2 @@ -0,0 +1,13 @@ +# /etc/idmapd.conf +# --- +# {{ ansible_managed }} +# --- + +[General] +Domain = {{ nfs_client_domain }} +Pipefs-Directory = /var/lib/nfs/rpc_pipefs +Verbosity = 0 + +[Mapping] +Nobody-User = nobody +Nobody-Group = nogroup diff --git a/roles/ntpd/handlers/main.yml b/roles/ntpd/handlers/main.yml new file mode 100644 index 0000000..51ffe29 --- /dev/null +++ b/roles/ntpd/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# ntpd handlers + +- name: restart "ntp" + service: > + name=ntp + state=restarted diff --git a/roles/ntpd/meta/main.yml b/roles/ntpd/meta/main.yml new file mode 100644 index 0000000..0abafc5 --- /dev/null +++ b/roles/ntpd/meta/main.yml @@ -0,0 +1,5 @@ +--- +# ntpd meta + +dependencies: + - { role: debian-base } diff --git a/roles/ntpd/tasks/main.yml b/roles/ntpd/tasks/main.yml new file mode 100644 index 0000000..ffcc4ed --- /dev/null +++ b/roles/ntpd/tasks/main.yml @@ -0,0 +1,34 @@ +--- +# ntpd tasks + +- name: /etc/ntp.conf file + tags: + - ntpd + template: > + dest=/etc/ntp.conf + group=root + mode=644 + owner=root + src=ntp.conf + notify: + - restart "ntp" + +- name: install "ntpdate" and "ntp" + tags: + - ntpd + - packages + apt: > + name={{ item }} + state=installed + with_items: + - ntpdate + - ntp + +- name: ensure service "ntp" is enabled and running + tags: + - ntpd + - services + service: > + enabled=yes + name=ntp + state=running diff --git a/roles/ntpd/templates/ntp.conf b/roles/ntpd/templates/ntp.conf new file mode 100644 index 0000000..044a8a4 --- /dev/null +++ b/roles/ntpd/templates/ntp.conf @@ -0,0 +1,22 @@ +# /etc/ntp.conf -- configuration for ntpd +# --- +# {{ ansible_managed }} +# --- + +driftfile /var/lib/ntp/ntp.drift +statsdir /var/log/ntpstats/ + +statistics loopstats peerstats clockstats +filegen loopstats file loopstats type day enable +filegen peerstats file peerstats type day enable +filegen clockstats file clockstats type day enable + +# NTP servers and time sources: +server ntp1.cust.hosteurope.de +server ntp2.cust.hosteurope.de +server 127.127.1.0 +fudge 127.127.1.0 stratum 13 + +# Local users may interrogate the ntp server more closely. +restrict 127.0.0.1 nomodify +restrict ::1 nomodify diff --git a/roles/postfix/handlers/main.yml b/roles/postfix/handlers/main.yml new file mode 100644 index 0000000..2ba9b82 --- /dev/null +++ b/roles/postfix/handlers/main.yml @@ -0,0 +1,7 @@ +--- +# postfix handlers + +- name: restart "postfix" + service: > + name=postfix + state=restarted diff --git a/roles/postfix/meta/main.yml b/roles/postfix/meta/main.yml new file mode 100644 index 0000000..2f117cb --- /dev/null +++ b/roles/postfix/meta/main.yml @@ -0,0 +1,5 @@ +--- +# postfix meta + +dependencies: + - { role: debian-base } diff --git a/roles/postfix/tasks/main.yml b/roles/postfix/tasks/main.yml new file mode 100644 index 0000000..3ab9eda --- /dev/null +++ b/roles/postfix/tasks/main.yml @@ -0,0 +1,84 @@ +--- +# postfix tasks + +- name: configure Postfix "mailname" + tags: + - mail + - packages + - postfix + debconf: > + name=postfix + question=postfix/mailname + value="{{ inventory_hostname }}" + vtype=select + +- name: configure Postfix "destinations" + tags: + - mail + - packages + - postfix + debconf: > + name=postfix + question=postfix/destinations + value="$myhostname, localhost.$mydomain, localhost" + vtype=select + +- name: install "postfix" package + tags: + - mail + - packages + - postfix + apt: > + state=installed + name=postfix + +- name: setup "/etc/mailname" + tags: + - mail + - postfix + template: > + dest=/etc/mailname + group=root + mode=644 + owner=root + src=mailname.j2 + notify: + - restart "postfix" + +- name: set Posfix "myorigin" + tags: + - mail + - postfix + lineinfile: > + dest=/etc/postfix/main.cf + group=root + line="myorigin = /etc/mailname" + mode=644 + owner=root + regexp="^myorigin" + notify: + - restart "postfix" + +- name: set Posfix "myhostname" + tags: + - mail + - postfix + lineinfile: > + dest=/etc/postfix/main.cf + group=root + line="myhostname = {{ inventory_hostname }}" + mode=644 + owner=root + regexp="^myhostname" + notify: + - restart "postfix" + +- name: ensure service "postfix" is enabled and running + tags: + - mail + - postfix + - services + service: > + enabled=yes + name=postfix + state=running diff --git a/roles/postfix/templates/mailname.j2 b/roles/postfix/templates/mailname.j2 new file mode 100644 index 0000000..1fad51f --- /dev/null +++ b/roles/postfix/templates/mailname.j2 @@ -0,0 +1 @@ +{{ inventory_hostname }} diff --git a/roles/sshd/meta/main.yml b/roles/sshd/meta/main.yml new file mode 100644 index 0000000..21fa3c5 --- /dev/null +++ b/roles/sshd/meta/main.yml @@ -0,0 +1,5 @@ +--- +# sshd meta + +dependencies: + - { role: debian-base } diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml new file mode 100644 index 0000000..5974883 --- /dev/null +++ b/roles/sshd/tasks/main.yml @@ -0,0 +1,22 @@ +--- +# sshd tasks + +- name: install SSH packages + tags: + - packages + - sshd + apt: > + state=latest + name={{ item }} + with_items: + - openssh-blacklist-extra + - ssh + +- name: ensure service "ssh" is enabled and running + tags: + - services + - sshd + service: > + enabled=yes + name=ssh + state=running -- 2.39.2