---

argument_specs:

  main:
    version_added: "0.0.1"
    short_description: Install and configure Anope.
    description:
      - "Install and configure the L(Anope,https://www.anope.org/) IRC services daemon."
      - "Execution of this role can be limited using the following tags:"
      - "C(role::anope:install): Install Anope from distribution packages."
      - "C(role::anope:config): Render the Anope configuration."
      - "C(role::anope): Apply all of the above."
    author: s3lph
    options:
      anope_services_botserv_enabled:
        description:
          - If C(true), enable BotServ.
          - If C(true), enable BotServ.
        type: bool
        default: false
      anope_services_chanserv_enabled:
        description:
          - If C(true), enable ChanServ.
          - If C(true), enable ChanServ.
        type: bool
        default: true
      anope_services_global_enabled:
        description:
          - If C(true), enable Global.
          - If C(true), enable Global.
        type: bool
        default: true
      anope_services_hostserv_enabled:
        description:
          - If C(true), enable HostServ.
          - If C(true), enable HostServ.
        type: bool
        default: false
      anope_services_memoserv_enabled:
        description:
          - If C(true), enable MemoServ.
          - If C(true), enable MemoServ.
        type: bool
        default: false
      anope_services_nickserv_enabled:
        description:
          - If C(true), enable NickServ.
          - If C(true), enable NickServ.
        type: bool
        default: true
      anope_services_operserv_enabled:
        description:
          - If C(true), enable OperServ.
          - If C(true), enable OperServ.
        type: bool
        default: true
      anope_empty_modules:
        description:
          - List of configuration-less modules to enable.
        type: list
        elements: str
        default: [help, m_sasl]
      anope_services_host:
        description:
          - >-
            The services.host define is used in multiple different locations throughout the configuration for services
            clients hostnames.
        type: str
        default: services.localhost.localdomain
      anope_uplink_host:
        description:
          - The IP or hostname of the IRC server you wish to connect Services to.
        type: str
        default: localhost
      anope_uplink_ipv6:
        description:
          - Enable if Services should connect using IPv6.
        type: bool
        default: true
      anope_uplink_ssl:
        description:
          - Enable if Services should connect using SSL.
          - You must have an SSL module loaded for this to work.
        type: bool
        default: false
      anope_uplink_port:
        description:
          - The port to connect to.
          - The IRCd MUST be configured to listen on this port, and to accept server connections.
        type: int
        default: 7000
      anope_serverinfo_name:
        description:
          - The hostname that Services will be seen as.
          - it must have no conflicts with any other server names on the rest of your IRC network.
        type: str
        default: services.localhost.localdomain
      anope_serverinfo_description:
        description:
          - "The text which should appear as the server's information in /WHOIS and similar queries."
        type: str
        default: Services for IRC Networks
      anope_serverinfo_pid:
        description:
          - The filename containing the Services process ID.
        type: str
        default: /var/run/anope/anope.pid
      anope_serverinfo_motd:
        description:
          - The filename containing the Message of the Day.
        type: str
        default: /etc/anope/services.motd
      anope_protocol_module_name:
        description:
          - This directive tells Anope which IRCd Protocol to speak when connecting.
        type: str
        default: inspircd3
      anope_protocol_module_use_server_side_mlock:
        description:
          - Some protocol modules can enforce mode locks server-side.
          - This reduces the spam caused by services immediately reversing mode changes for locked modes.
        type: bool
        default: true
      anope_protocol_module_use_server_side_topiclock:
        description:
          - Some protocol modules can enforce topic locks server-side.
          - This reduces the spam caused by services immediately reversing topic changes.
        type: bool
        default: true
      anope_networkinfo_networkname:
        description:
          - This is the name of the network that Services will be running on.
        type: str
        default: LocalNet
      anope_networkinfo_nicklen:
        description:
          - Set this to the maximum allowed nick length on your network.
        type: int
        default: 31
      anope_networkinfo_userlen:
        description:
          - Set this to the maximum allowed ident length on your network.
        type: int
        default: 10
      anope_networkinfo_hostlen:
        description:
          - Set this to the maximum allowed hostname length on your network.
        type: int
        default: 64
      anope_networkinfo_chanlen:
        description:
          - Set this to the maximum allowed channel length on your network.
        type: int
        default: 32
      anope_networkinfo_modelistsize:
        description:
          - The maximum number of list modes settable on a channel (such as C(b), C(e), C(I)).
        type: int
        default: 100
      anope_networkinfo_vhost_chars:
        description:
          - The characters allowed in hostnames.
        type: str
        default: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-"
      anope_networkinfo_allow_undotted_vhosts:
        description:
          - If set to true, allows vHosts to not contain dots.
        type: bool
        default: false
      anope_networkinfo_disallow_start_or_end:
        description:
          - The characters that are not allowed to be at the very beginning or very ending of a vHost.
        type: str
        default: ".-"
      anope_options_casemap:
        description:
          - The case mapping used by services.
        type: str
        default: ascii
      anope_options_strictpasswords:
        description:
          - If set, Services will perform more stringent checks on passwords.
        type: bool
        default: true
      anope_options_badpasslimit:
        description:
          - Sets the number of invalid password tries before Services removes a user from the network.
        type: int
        default: 5
      anope_options_badpasstimeout:
        description:
          - Sets the time after which invalid passwords are forgotten about.
        type: str
        default: 1h
      anope_options_updatetimeout:
        description:
          - Sets the delay between automatic database updates.
        type: str
        default: 5m
      anope_options_expiretimeout:
        description:
          - Sets the delay between checks for expired nicknames and channels.
        type: str
        default: 30m
      anope_options_readtimeout:
        description:
          - Sets the timeout period for reading from the uplink.
        type: str
        default: 5s
      anope_options_warningtimeout:
        description:
          - Sets the interval between sending warning messages for program errors via WALLOPS/GLOBOPS.
        type: str
        default: 4h
      anope_options_timeoutcheck:
        description:
          - Sets the (maximum) frequency at which the timeout list is checked.
        type: str
        default: 3s
      anope_options_retrywait:
        description:
          - How long to wait between connection retries with the uplink(s).
        type: str
        default: 60s
      anope_options_hideprivilegedcommands:
        description:
          - "If set, Services will hide commands that users don't have the privilege to execute from HELP output."
        type: bool
        default: true
      anope_options_hideregisteredcommands:
        description:
          - "If set, Services will hide commands that users can't execute because they are not logged in from HELP output."
        type: bool
        default: true
      anope_options_languages:
        description:
          - A list of languages to load on startup that will be available in /NICKSERV SET LANGUAGE.
        type: list
      anope_options_defaultlanguage:
        description:
          - Default language that non- and newly-registered nicks will receive messages in.
        type: str
        default: en_US.UTF-8
      anope_log:
        description:
          - This section is used for configuring what is logged and where it is logged to.
        type: list
      anope_opertypes:
        description:
          - This section is used to set up staff access to restricted oper only commands.
        type: dict
      anope_opers:
        description:
          - List of operators and their access levels.
        type: dict
        default: {}
      anope_database_flatfile_filename:
        description:
          - The database name db_flatfile should use.
        type: str
        default: anope.db
      anope_database_flatfile_keepbackups:
        description:
          - Sets the number of days backups of databases are kept.
        type: int
        default: 3
      anope_database_flatfile_nobackupok:
        description:
          - >-
            Allows Services to continue file write operations (i.e. database saving) even if the original file cannot
            be backed up.
        type: bool
        default: false
      anope_database_flatfile_fork:
        description:
          - If enabled, services will fork a child process to save databases.
        type: bool
        default: false
      anope_password_hash:
        description:
          - Name of the primary password hashing module without the C(enc_) prefix.
        type: str
        default: bcrypt
      anope_additional_config:
        description:
          - Wilcard option to append arbitrary additional configuration.
        type: str
        default: ""
      anope_nickserv_service_nick:
        description:
          - The name of the NickServ client.
        type: str
        default: NickServ
      anope_nickserv_servie_user:
        description:
          - The username of the NickServ client.
        type: str
        default: services
      anope_nickserv_service_host:
        description:
          - The hostname of the NickServ client.
        type: str
        default: services.host
      anope_nickserv_service_gecos:
        description:
          - The realname of the NickServ client.
        type: str
        default: Nickname Registration Service
      anope_nickserv_module_client:
        description:
          - The name of the client that should be NickServ.
        type: str
        default: NickServ
      anope_nickserv_module_forceemail:
        description:
          - Force users to give an e-mail address when they register a nick.
        type: bool
        default: true
      anope_nickserv_module_confirmemailchanges:
        description:
          - Require users who change their email address to confirm they own their new email.
        type: bool
        default: false
      anope_nickserv_module_defaults:
        description:
          - The default options for newly registered nicks.
        type: list
        default: [killprotect, ns_secure, ns_private, hide_email, hide_mask, memo_signon, memo_receive, autoop]
      anope_nickserv_module_regdelay:
        description:
          - "The minimum length of time between consecutive uses of NickServ's REGISTER command."
        type: str
        default: 30s
      anope_nickserv_module_expire:
        description:
          - "The length of time before a nick's registration expires."
        type: str
        default: 21d
      anope_nickserv_module_secureadmins:
        description:
          - >-
            Prevents the use of the ACCESS and CERT DROP, FORBID, SUSPEND, GETPASS and SET PASSWORD commands by services
            operators on other services operators.
        type: bool
        default: true
      anope_nickserv_module_modeonid:
        description:
          - >-
            If set, Services will set the channel modes a user has access to upon identifying, assuming they are not
            already set.
        type: bool
        default: true
      anope_nickserv_module_hidenetsplitquit:
        description:
          - "If set, Services will not show netsplits in the last quit message field of NickServ's INFO command."
        type: bool
        default: false
      anope_nickserv_module_killquick:
        description:
          - "Length of time NickServ's killquick option waits before forcing users off of protected nicknames."
        type: str
        default: 20s
      anope_nickserv_module_kill:
        description:
          - "Length of time NickServ's kill option waits before forcing users off of protected nicknames."
        type: str
        default: 60s
      anope_nickserv_module_enforceruser:
        description:
          - The username used for fake users created when Services needs to hold a nickname.
        type: str
        default: enforcer
      anope_nickserv_module_enforcerhost:
        description:
          - The hostname used for fake users created when Services needs to hold a nickname.
        type: str
        default: services.host
      anope_nickserv_module_releasetimeout:
        description:
          - The length of time Services hold nicknames.
        type: str
        default: 1m
      anope_nickserv_module_guestnickprefix:
        description:
          - "When a users nick is forcibly changed to enforce a nick kill, their new nick will start with this value."
        type: str
        default: Guest
      anope_nickserv_module_nonicknameownership:
        description:
          - If set, Services do not allow ownership of nick names, only ownership of accounts.
        type: bool
        default: false
      anope_nickserv_module_passlen:
        description:
          - The maximum length of passwords.
        type: int
        default: 32
      anope_chanserv_service_nick:
        description:
          - The name of the ChanServ client.
        type: str
        default: ChanServ
      anope_chanserv_servie_user:
        description:
          - The username of the ChanServ client.
        type: str
        default: services
      anope_chanserv_service_host:
        description:
          - The hostname of the ChanServ client.
        type: str
        default: services.host
      anope_chanserv_service_gecos:
        description:
          - The realname of the ChanServ client.
        type: str
        default: Channel Registration Service
      anope_chanserv_module_client:
        description:
          - The name of the client that should be ChanServ.
        type: str
        default: ChanServ
      anope_chanserv_module_defaults:
        description:
          - The default options for newly registered channels.
        type: list
        elements: str
        default: [keeptopic, peace, cs_secure, securefounder, signkick]
      anope_chanserv_module_maxregistered:
        description:
          - The maximum number of channels which may be registered to a single nickname.
        type: int
        default: 20
      anope_chanserv_module_expire:
        description:
          - The length of time before a channel registration expires.
        type: str
        default: 14d
      anope_chanserv_module_accessmax:
        description:
          - "The maximum number of entries on a channel's access list."
        type: int
        default: 1024
      anope_chanserv_module_inhabit:
        description:
          - >-
            The length of time ChanServ stays in a channel after kicking a user from a channel they are not permitted
            to be in.
        type: str
        default: 15s
      anope_chanserv_module_reasonmax:
        description:
          - The maximum length of the reason field for user commands such as chanserv/kick and chanserv/ban.
        type: int
        default: 200
      anope_chanserv_module_signkickformat:
        description:
          - The message formatting to use for signed kick messages.
          - "%n is the nick of the kicker."
          - "%m is the message specified."
        type: str
        default: "%m (%n)"
      anope_chanserv_module_disallow_hostmask_access:
        description:
          - If set, prevents channel access entries from containing hostmasks.
        type: bool
        default: false
      anope_chanserv_module_disallow_channel_access:
        description:
          - If set, prevents channels from being on access lists.
        type: bool
        default: false
      anope_chanserv_module_always_lower_ts:
        description:
          - If set, ChanServ will always lower the timestamp of registered channels to their registration date.
        type: bool
        default: false