Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

Latest commit

 

History

History
61 lines (57 loc) · 1.7 KB

README.md

File metadata and controls

61 lines (57 loc) · 1.7 KB

ansible-ct-filter

Container Linux Config Transpiler filter for Ansible. Filters a Container Linux Configuration YAML into an Ignition Configuration.

Dependencies

Typical working directory

./filter_plugins/ct.py
./bin/ct

Usage

# Platform argument to ct() required.
# Note the usage of the string filter. This prevents
#   the resulting json object from being marshalled
#   into a dictionary.
user_data: "{{ container_linux_config_data | ct('ec2') | string }}"

In a playbook

---
- hosts: localhost
  vars:
    cl_config:
      etcd:
        version: 3.0.15
        name: '{HOSTNAME}'
        listen_client_urls: >
          http://{PRIVATE_IPV4}:2379,
          http://localhost:2379
        discovery_srv: 'example.com'
        proxy: 'on'
      locksmith:
        reboot_strategy: 'etcd-lock'
      update:
        group: 'stable'
      flannel:
        version: 0.7.0
      systemd:
        units:
          - name: flanneld.service
            enable: true
            dropins:
              - name: 50-network-config.conf
                contents: |
                  [Service]
                  ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config \
                    "{\"Network\":\"10.10.41.0/20\", \
                      \"SubnetLen\": 28, \
                      \"SubnetMin\": \"10.10.41.0\", \
                      \"SubnetMax\": \"10.10.47.240\" \
                    }"
  tasks:
    - debug:
        msg: "{{cl_config|ct('ec2')}}"