dudefellah.iac

dudefellah.iac

这是一个通用的安装和配置(iac)角色。它将为你的操作系统安装一些软件包,基于你提供的文本安装一些文件,并根据更改的配置文件可选择性地重新加载或重启服务。

这可能不是每个人都喜欢的角色,但我认为它对于我进行的众多简单软件安装是有用的,这类安装可能不需要定义完整的角色来管理。

如果你使用此角色安装一些配置文件,这里包括一些基本模板,用于安装 .ini.json.yaml 文件。

需求

没有。

角色变量

角色变量在 defaults/main.yml 中用注释定义。

依赖

没有。

示例剧本

如果你想为特定用户安装和配置 vdirsyncer(注意这个剧本未经过测试,但可以给你一个它如何工作的概念):

    - hosts: all
      tasks:
        - name: 安装并配置 vdirsyncer
          include_role:
            name: dudefellah.iac
          vars:
            iac_user: bob
            iac_group: bob
            iac_packages:
              - vdirsyncer
            iac_handler_service_name: null
            iac_handler_command: vdirsyncer sync
            iac_config_files:
              - path: .config/vdirsyncer/config
                content: |
                    [general]
                    status_path = "~/.vdirsyncer/status"

                    ...

或者为你的 x11 设置安装 polybar。使用 validini 验证你的 .ini 文件:

        - name: 安装并配置 polybar
          include_role:
            name: dudefellah.iac
          vars:
            iac_user: bob
            iac_group: bob
            iac_config_files:
              - path: .config/polybar/config
                src: iac.ini.j2
                vars:
                  colors:
                    background: "#222"
                    background-alt: "#444"
                    ...
                validate: "validini %s"

许可证

GPLv2+

作者信息

Dan - github.com/dudefellah

关于项目

Generic package install and configuration role

安装
ansible-galaxy install dudefellah.iac
许可证
Unknown
下载
15.7k
拥有者