{"id":19235214,"url":"https://github.com/sensson/puppet-directadmin","last_synced_at":"2025-04-21T05:31:54.453Z","repository":{"id":22640512,"uuid":"25983386","full_name":"sensson/puppet-directadmin","owner":"sensson","description":"A Puppet module to manage DirectAdmin and Custombuild.","archived":false,"fork":false,"pushed_at":"2020-03-06T11:46:15.000Z","size":133,"stargazers_count":13,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T17:12:51.089Z","etag":null,"topics":["directadmin","puppet"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sensson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-30T18:03:53.000Z","updated_at":"2024-07-30T07:11:24.000Z","dependencies_parsed_at":"2022-08-05T18:30:22.728Z","dependency_job_id":null,"html_url":"https://github.com/sensson/puppet-directadmin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpuppet-directadmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpuppet-directadmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpuppet-directadmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sensson%2Fpuppet-directadmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sensson","download_url":"https://codeload.github.com/sensson/puppet-directadmin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223849176,"owners_count":17213640,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directadmin","puppet"],"created_at":"2024-11-09T16:16:18.452Z","updated_at":"2024-11-09T16:16:19.109Z","avatar_url":"https://github.com/sensson.png","language":"Ruby","readme":"# directadmin\n\n[![Build Status](https://travis-ci.org/sensson/puppet-directadmin.svg?branch=master)](https://travis-ci.org/sensson/puppet-directadmin) [![Puppet Forge](https://img.shields.io/puppetforge/v/sensson/directadmin.svg?maxAge=2592000?style=plastic)](https://forge.puppet.com/sensson/directadmin)\n\nThis module is used to configure DirectAdmin.\n\nIt can manage the installation of DirectAdmin, admin and reseller users and their \npackages. It is not meant to replace the API or other functionality from DirectAdmin.\n\nPull requests and bug reports are always appreciated.\n\n## Examples\n\n### Installation and configuration\n\nThis will install DirectAdmin if it has not been installed yet. You will need\nto specify the client and license id here. Keep in mind that when you enable\nthis module on an existing server, certain options may be overwritten.\n\nIf you don't specify an `interface` it will default to venet0:0 on OpenVZ containers\nand eth0 on other systems. You can override this setting or not set it at all.\n\nSet `lan` to true when using [DirectAdmin behind a NAT](http://www.directadmin.com/lan.shtml).\n\n```\nclass { 'directadmin':\n    clientid       =\u003e '1000',\n    licenseid      =\u003e '10000',\n    interface      =\u003e 'eth0',\n    admin_password =\u003e '$1$xyz$4SuXM/NcNyHdr1j2DppL5/',\n    lan            =\u003e false,\n}\n```\n\n## Reference\n\n### Parameters\n\n#### directadmin\n\nWe provide a number of configuration options to change particular settings\nor to override our defaults when required.\n\n##### `clientid`\n\nThis is the client id for your DirectAdmin license. Required. Defaults to undef.\n\n##### `licenseid`\n\nThis is the licence id for your DirectAdmin license. Required. Defaults to undef.\n\n##### `interface`\n\nChange the interface for your license. Defaults to eth0 or venet0:0 on OpenVZ.\n\n##### `auto_update`\n\nSet this to true if you want Puppet to check for custombuild updates. Defaults to false.\n\n##### `admin_password`\n\nManage the admin user password. Recommended if you want to manage admin users, reseller\npackages and resellers. This needs to be a hash. Defaults to undef.\n\n##### `lan`\n\nSet `lan` to true when using [DirectAdmin behind a NAT](http://www.directadmin.com/lan.shtml).\n\n##### `mail_limit`\n\nSet a maximum outgoing mail limit per user account. Defaults to 200.\n\n##### `mail_limit_per_address`\n\nSet a maximum outgoing mail limit per e-mail address. Defaults to 0 (no limit).\n\n##### `sa_updates`\n\nSet this to true if you want to enable daily SpamAssassin updates. Defaults to false.\n\n##### `php_imap`\n\nSet this to true if you want to enable the imap extension in PHP. Defaults to false.\n\n##### `default_webmail`\n\nSet the default webmail client. Defaults to roundcube.\n\n##### `default_rbl`\n\nThis creates a symlink that makes sure all e-mail domains are checked agains the RBL's\nin Exim. Defaults to false.\n\n##### `installer_location`\n\nOverride the DirectAdmin installer location. Defaults to http://www.directadmin.com/setup.sh.\n\n##### `modsecurity`\n\nEnable ModSecurity. Defaults to false.\n\n##### `modsecurity_ruleset`\n\nEnable a ModSecurity ruleset. Valid options comodo/owasp/false. Defaults to false.\n\n##### `modsecurity_wordpress`\n\nEnable a WordPress brute force prevention ruleset. Defaults to false.\n\n#### directadmin::services::named\n\nWe currently only support managing small portions of named. We have implemented two features:\n\n* Managing also-notify, allow-transfer and notify settings\n* Managing named rewrites (in case you are managing custom DNS templates)\n\nYou can enable `also-notify` and `allow-transfer` by passing the relevant parameters to this class.\n\n```\nclass directadmin::services::named { also-notify =\u003e '1.2.3.4', allow-transfer =\u003e '1.2.3.4' }\n```\n\nAside from that this module allows you to rewrite named, e.g. what's described here:\nhttp://help.directadmin.com/item.php?id=141\n\nYou can do this with:\n\n```\nnotify =\u003e Exec['rewrite-named-config'],\n```\n\n##### `allow_transfer`\n\nSet up an IP address to allow zone transfers. Defaults to ''.\n\n##### `also_notify`\n\nAlso notify this IP address when zone changes occur. Defaults to ''.\n\n##### `ensure_transfer`\n\nMake sure this configuration exists or not. Defaults to 'present'.\n\n##### `ensure_notify`\n\nMake sure this configuration exists or not. Defaults to 'present.'\n\n### Defines\n\n#### directadmin::config::set\n\nThis module allows you to configure DirectAdmin. We support all DirectAdmin \nconfiguration settings. Be careful though, we don't check if the settings are\nactually valid. It will set it to whatever value you have specified.\n\n```\ndirectadmin::config::set { 'brute_force_log_scanner': value =\u003e '0', }\n```\n\nIt also supports Hiera. If you want, you can specify a number of settings by simply\nadding something similar to the following to your node's configuration files:\n\n```\ndirectadmin::config::options:\n  brute_force_log_scanner:\n    value: 0\n  timeout:\n    value: 30\n  enable_ssl_sni:\n    value: 1\n```\n\n##### `value`\n\nSet the value of the configuration item you want to change. Defaults to ''\n\n#### directadmin::custombuild::set\n\nCustombuild plays an important role in DirectAdmin's configurations and settings of\nthe software it uses to provide its services. Custombuild can be managed with this\nmodule in a similar fashion as you would expect the command line to work. It is\nautomatically installed when you use this module.\n\nWe support all options Custombuild supports out of the box. There will never be any\naddtional configuration required. If you want to change an option you can use the\nfollowing function:\n\n```\ndirectadmin::custombuild::set { 'php1_release': value =\u003e '5.5', }\n```\n\nIt also supports Hiera. If you want, you can specify a number of settings by simply\nadding something similar to the following to your node's configuration files:\n\n```\ndirectadmin::custombuild::options:\n  php1_release: \n    value: '5.5'\n  mysql: \n    value: '5.5'\n  apache_ver: \n    value: '2.4'\n  spamassassin:\n    value: 'yes'\n```    \n\nAll settings can be set before the installation runs.\n\nWhen you make any changes to a setting in the custombuild options class it will \nautomatically update the setting in /usr/local/directadmin/custombuild/options.conf but\nit will not trigger a reinstallation of a particular feature in custombuild. If you do\nwant to do this, you can. For example by using something similar as the code below.\n\n```\nexec { 'rebuild-php':\n    command     =\u003e '/usr/local/directadmin/custombuild/build php n',\n    subscribe   =\u003e Directadmin::Custombuild::Set['php1_release'],\n    require     =\u003e Class['directadmin::install'],\n    refreshonly =\u003e true,\n}\n```\n\n##### `value`\n\nSet the value of the configuration item you want to change. Defaults to ''\n\n#### directadmin::mail::spamassassin::score\n\nIf you need to set custom rules for SpamAssassin you can do so with the following function:\n\n```\ndirectadmin::mail::spamassassin::score { 'URIBL_BLOCKED': score =\u003e 3, }\n```\n\n##### `score`\n\nSet the score for a specific SpamAssassin check. Defaults to 1.\n\n#### directadmin::mail::spamassassin::config\n\nThis allows you to create larger configuration files with specific settings. These configuration\nfiles will be created in /etc/mail/spamassassin. It is possible to specify a prefix with the\n`order` parameter as SpamAssassin reads these files in alphabetical order.\n\nThe filename will be `$order-$title.cf` and cannot be changed.\n\n##### `ensure`\n\nValid values: present, absent. Defaults to 'present'.\n\n##### `content`\n\nSet the content of the configuration file. Defaults to ''.\n\n##### `order`\n\nSet the order in which the files should be read. Numeric values are recommended. Defaults to '99'.\n\n#### directadmin::mail::exim::config\n\nThis allows you to set override custom configurations such as in exim.strings.conf.custom. It takes\ntitle as its setting. It will automatically notify Exim to reload.\n\n##### `file`\n\nValid values are e.g. 'exim.strings.conf.custom'. Do not specify a path. Defaults to 'undef'.\n\n##### `value`\n\nSet the value for the setting you're changing. Defaults to 'undef'.\n\n#### directadmin::mail::exim::virtual\n\nThis allows you to set values in /etc/virtual. You can manage 'skip_rbl_hosts_ip' for example.\n\n##### `file`\n\nValid values are e.g. 'skip_rbl_hosts_ip'. Do not specify a path. Defaults to 'undef'.\n\n##### `value`\n\nSet the value. Defaults to 'undef'.\n\n### Resources\n\nDirectAdmin provides an API to automate certain actions. This module implements a few resources\nto simplify the initial set up of a server with DirectAdmin. It's not going to replace the existing\nweb interface as it is simply not meant for that. Please keep in mind that this is a very basic\nimplementation of resources for Puppet, not all features are supported. They are considered helper\nfunctions. They will add or remove resources only.\n\nYou may want to have a look at the DirectAdmin API docs to see what certain settings do or require. \nResources will in most cases follow the directions in http://www.directadmin.com/api.html.\n\nEvery resource will have the following settings:\n\n* `api_username` needs to be set to the user with access to the API.\n* `api_password` is the password for the user mentioned before.\n* `api_hostname` you need to change this if your API is not accessible on localhost.\n* `api_port` if you run DirectAdmin on a different port than 2222 this allows you to change that.\n\nNOTE: As the installer will not return a username or password to Puppet and we have not and will not\nimplement a feature that reads passwords from setup.txt for example, we recommend that you set up\na resource to manage the admin user before running any custom resources, e.g. just after the installer\nhas finished.\n\n#### Set up a new admin user\n\nIt only manages the `email` and `password` property. Changing them will update the user.\n\n```\ndirectadmin_admin { \"username\":\n    ensure        =\u003e present,\n    password      =\u003e \"password\",\n    email         =\u003e \"your@email.address\"\n    notifications =\u003e \"no\",\n    api_username  =\u003e \"admin\",\n    api_password  =\u003e \"api_password\",\n    api_hostname  =\u003e \"localhost (default)\",\n    api_port      =\u003e \"2222 (default)\",\n    api_ssl       =\u003e false (default),\n}\n```\n\n#### Set up a new reseller package\n\nYou will need to set up a reseller package before you can create a reseller. All values\nare manageable, as in, you can change them after a package has been created. Renaming\npackages is not supported though.\n\n```\ndirectadmin_reseller_package { \"newpackage2\":\n    ensure       =\u003e present,\n    aftp         =\u003e on,\n    bandwidth    =\u003e 1000,\n    catchall     =\u003e on,\n    cgi          =\u003e on,\n    cron         =\u003e on,\n    dns          =\u003e off/two/three,\n    dnscontrol   =\u003e on,\n    domainptr    =\u003e 2000,\n    domains      =\u003e 3000,\n    ftp          =\u003e 4000,\n    inodes       =\u003e 5000,\n    ips          =\u003e 1,\n    login_keys   =\u003e on,\n    mysql        =\u003e 6000,\n    nemailf      =\u003e 7000,\n    nemails      =\u003e 8000,\n    nemailml     =\u003e 9000,\n    nemailr      =\u003e 10000,\n    nsubdomains  =\u003e 11000,\n    quota        =\u003e 12000,\n    php          =\u003e on,\n    spamassassin =\u003e on,\n    ssl          =\u003e on,\n    ssh          =\u003e on,\n    userssh      =\u003e on,\n    oversell     =\u003e on,\n    sysinfo      =\u003e on,\n    serverip     =\u003e on,\n    api_username =\u003e \"admin\",\n    api_password =\u003e \"api_password\",\n    api_hostname =\u003e \"localhost (default)\",\n    api_port     =\u003e \"2222 (default)\",\n    api_ssl      =\u003e false (default),\n}\n```\n\n#### Set up a new reseller\n\nIt only manages the `email` and `password` property. Changing them will update the user.\n\n```\ndirectadmin_reseller { \"resellername\":\n    ensure        =\u003e present,\n    password      =\u003e \"password\",\n    email         =\u003e \"your@email.address\",\n    domain        =\u003e \"yourdomain.com\",\n    ip_address    =\u003e \"shared\",\n    user_package  =\u003e \"an_existing_package\",\n    notifications =\u003e \"no\",\n    api_username  =\u003e \"admin\",\n    api_password  =\u003e \"api_password\",\n    api_hostname  =\u003e \"localhost (default)\",\n    api_port      =\u003e \"2222 (default)\",\n    api_ssl       =\u003e false (default),\n}\n```\n\n#### Set up a new user package\n\nAll values are manageable, as in, you can change them after a package has been created. \nRenaming packages is not supported though.\n\n```\ndirectadmin_user_package { \"bronze\":\n    ensure           =\u003e present,\n    aftp             =\u003e off,\n    bandwidth        =\u003e 25000,\n    catchall         =\u003e on,\n    cgi              =\u003e on,\n    cron             =\u003e on,\n    dnscontrol       =\u003e on,\n    domainptr        =\u003e 1001,\n    domains          =\u003e 1,\n    ftp              =\u003e 2001,\n    inodes           =\u003e 3001,\n    language         =\u003e 'en',\n    login_keys       =\u003e on,\n    mysql            =\u003e 4001,\n    nemailf          =\u003e 5001,\n    nemails          =\u003e 6001,\n    nemailml         =\u003e 7001,\n    nemailr          =\u003e 8001,\n    nsubdomains      =\u003e unlimited,\n    quota            =\u003e 1000,\n    php              =\u003e on,\n    spamassassin     =\u003e on,\n    ssl              =\u003e on,\n    sysinfo          =\u003e on,\n    suspend_at_limit =\u003e on,\n    skin             =\u003e 'enhanced',\n    api_username     =\u003e \"reseller\",\n    api_password     =\u003e \"api_password\",\n    api_hostname     =\u003e \"localhost (default)\",\n    api_port         =\u003e \"2222 (default)\",\n    api_ssl          =\u003e false (default),\n}\n```\n\n## Limitations\n\nThis module has been tested on:\n\n* CentOS 6\n* CentOS 7\n* Debian 7\n\n## Development\n\nWe strongly believe in the power of open source. This module is our way\nof saying thanks.\n\nThis module is tested against the Ruby versions from Puppet's support\nmatrix. Please make sure you have a supported version of Ruby installed.\n\nIf you want to contribute please:\n\n1. Fork the repository.\n2. Run tests. It's always good to know that you can start with a clean slate.\n3. Add a test for your change.\n4. Make sure it passes.\n5. Push to your fork and submit a pull request.\n\nWe can only accept pull requests with passing tests.\n\nTo install all of its dependencies please run:\n\n```\nbundle install --path vendor/bundle --without development\n```\n\n### Running unit tests\n\n```\nbundle exec rake test\n```\n\n### Running acceptance tests\n\nThe unit tests only verify if the code runs, not if it does exactly\nwhat we want on a real machine. For this we use Beaker. Beaker will\nstart a new virtual machine (using Vagrant) and runs a series of\nsimple tests.\n\nBeaker is currently not supported due to licensing constraints.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensson%2Fpuppet-directadmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsensson%2Fpuppet-directadmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsensson%2Fpuppet-directadmin/lists"}