{ "info": { "author": "Adfinis SyGroup AG", "author_email": "info@adfinis-sygroup.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Topic :: System :: Systems Administration" ], "description": "foreman-yml\n===========\n\n|PyPi| |License|\n\n.. |PyPi| image:: https://img.shields.io/pypi/v/foreman-yml.svg?style=flat-square\n :target: https://pypi.python.org/pypi/foreman-yml\n.. |License| image:: https://img.shields.io/badge/license-GPLv3-blue.svg?style=flat-square\n :target: LICENSE\n\nMake automated foreman configuration as easy as pie.\n\nThis script automatically resolves names so you can link templates,\nhosts, domains with only using their names. It's not required to know\ntheir ids beforehand.\n\nInstallation\n------------\n\n::\n\n git clone https://github.com/adfinis-sygroup/foreman-yml --recursive\n cd foreman-yml\n sudo pip install .\n\nNote CentOS/RHEL\n~~~~~~~~~~~~~~~~\n\n::\n sudo yum install gcc python-devel python-pip python-argparse -y\n\nUsage\n-----\n\n::\n\n foreman-yml [import|dump|cleanup] /path/to/config.yaml\n\nConfiguration\n~~~~~~~~~~~~~\n\nRoot node of YAML is always ``foreman``. You can find an configuration\nexample under ``config/example.yml``\n\nDump current configuration\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nforeman-yml supports dumping the whole configuration of a remote foreman\ninstance to sdout. Use ``foreman-yml dump`` for this feauture.\n\nFor dumping, provide an config file with auth settings:\n\n.. code:: yaml\n\n foreman:\n auth:\n url: \"https://foreman.lab.local\"\n user: username\n pass: password\n\nThen run foreman-yml like this to dump configuration:\n\n::\n\n foreman-yml dump /path/to/config.yml > foreman_dump.yml\n\nImport settings into foreman\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf no keyword or ``import`` is provided to ``foreman-yml``, the script\ntries to import settings provided by yaml-file.\n\n::\n\n foreman-yml /path/to/config.yml\n foreman-yml dump /path/to/config.yml\n\nThe following config sections are supported:\n\nSection ``auth``\n^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n auth:\n url: \"https://foreman.lab.local\"\n user: username\n pass: password\n\n- **url** URL of your foreman instance\n- **user** Username for connecting to the API. User should have\n administrative rights\n- **pass** Password for the User\n\nSection ``setting``\n^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n setting:\n - name: entries_per_page\n value: 42\n - name: safemode_render\n value: false\n\nKey/Value pair for global foreman settings\n\n- **name** Key\n- **value** Value\n\nSection ``architecture``\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n architecture:\n - name: x86_64\n - name: i386\n\n- **name** Architecture string (Example: 'x86\\_64')\n\nSection ``environment``\n^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n environment:\n - name: production\n - name: development\n - name: staging\n\n- **name** Environment name\n\nSection ``smart-proxy``\n^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n smart-proxy:\n - name: smproxy01\n url: \"http://localhost:8000/\"\n\n- **name** Smart proxy name\n- **url** Smart proxy url\n\nSection ``domain``\n^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n domain:\n - name: lab.local\n fullname: lab.local is a test domain\n dns-proxy: smproxy01\n parameters:\n - name: keyname\n value: keyvalue\n\n- **name** Domain name\n- **fullname** Detailed description\n- **dns-proxy** DNS proxy for the domain. Maps to ``smart-proxy.name``\n- **parameters** Extra parameters, key/value pair\n- **name** Key\n- **value** Value\n\nSection ``subnet``\n^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n subnet:\n - name: lab\n network: 192.168.122.0\n mask: 255.255.255.0\n gateway: 192.168.122.1\n dns-primary: 192.168.122.1\n dns-secondary: 8.8.8.8\n ipam: DHCP\n from: 192.168.122.10\n to: 192.168.122.50\n vlanid:\n domain:\n - name: lab.local\n dhcp-proxy: Smart Proxy\n tftp-proxy: Smart Proxy\n dns-proxy:\n boot-mode: DHCP\n network-type: IPv4\n\n- **name** Subnet name\n- **network** Network address\n- **mask** Network Netmask\n- **gateway** Network gateway\n- **dns-primary** Primary DNS server\n- **dns-secondary** Secondary DNS server\n- **ipam** IP Address auto suggestion mode for this subnet, valid\n values are \"DHCP\", \"Internal DB\", \"None\"\n- **from** Starting IP Address for IP auto suggestion\n- **to** Ending IP Address for IP auto suggestion\n- **vlanid** VLAN ID for this subnet\n- **domain** Domains in which this subnet is part\n- **name** Domain name, maps to ``domain.name``\n- **dhcp-proxy** DHCP Proxy to use within this subnet, maps to\n ``smart-proxy.name``\n- **tftp-proxy** TFTP Proxy to use within this subnet, maps to\n ``smart-proxy.name``\n- **dns-proxy** DNS Proxy to use within this subnet, maps to\n ``smart-proxy.name``\n- **boot-mode** Default boot mode for interfaces assigned to this\n subnet, valid values are \"Static\", \"DHCP\"\n- **network-type** Type or protocol, IPv4 or IPv6, defaults to IPv4,\n valid values are \"IPv4\", \"IPv6\"\n\nSection ``model``\n^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n model:\n - name: libvirt\n info: Virtual Machine\n vendor-class: vmware\n hardware-model: esxi6\n\n- **name** Model name\n- **info** Detailed description\n- **vendor-class** Hardware vendor\n- **hardware-model** Hardware model\n\nSection ``medium``\n^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n medium:\n - name: Ubuntu Mirror\n path: \"http://archive.ubuntu.com/ubuntu\"\n os-family: Debian\n\n- **name** Model name\n- **path** The path to the medium, can be a URL or a valid NFS server\n (exclusive of the architecture)\n- **os-family** Operating system family, available values: AIX,\n Altlinux, Archlinux, Coreos, Debian, Freebsd, Gentoo, Junos, NXOS,\n Redhat, Solaris, Suse, Windows\n\nSection ``partition-table``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n partition-table:\n - name: Ubuntu Default\n os-family: Debian\n audit-comment: initial import\n layout: |\n #!ipxe\n <%#\n kind: iPXE\n name: RLC iPXE\n oses:\n - Ubuntu 14.04\n %>\n [...]\n locked: false\n\n- **name** Partition table name\n- **os-family** Operating system family, available values: AIX,\n Altlinux, Archlinux, Coreos, Debian, Freebsd, Gentoo, Junos, NXOS,\n Redhat, Solaris, Suse, Windows\n- **audit-comment** Comment for the audit log\n- **layout** Partition layout\n- **locked** Whether or not the template is locked for editing\n\nSection ``provisioning-template``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n provisioning-template:\n name: Ubuntu Preseed\n template: |\n <%#\n kind: provision\n name: Ubuntu Preseed\n oses:\n - Debian 8.\n %>\n [...]\n snippet: false\n audit-comment: initial import\n template-kind-id: 3\n template-combination-attribute:\n os:\n - name: Debian 8\n locked: false\n\n- **name** Partition table name\n- **template** The provisioning template itself\n- **snippet** Set to true if template is a snippet only\n- **audit-comment** Comment for the audit log\n- **template\\_kind\\_id** Template kind id\n- **os**\n- **name** Operating system name, maps to ``os.name``\n- **locked** Whether or not the template is locked for editing\n\nSection ``os``\n^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n os:\n - name: Ubuntu\n major: 14\n minor: 4\n description: Ubuntu 14.04 LTS\n family: Debian\n release-name: trusty\n password-hash: SHA512\n architecture:\n - name: x86_64\n provisioning-template:\n - name: Ubuntu PXE\n - name: Ubuntu Preseed\n medium:\n - name: Ubuntu Mirror\n partition-table:\n - name: Ubuntu Default\n parameters:\n version: \"14.04\"\n codename: \"trusty\"\n\n- **name** Operating system table name\n- **major** The provisioning template itself\n- **minor** Set to true if template is a snippet only\n- **description** Comment for the audit log\n- **family** Operating system family, available values: AIX, Altlinux,\n Archlinux, Coreos, Debian, Freebsd, Gentoo, Junos, NXOS, Redhat,\n Solaris, Suse, Windows\n- **release-name** OS release name\n- **password-hash** Root password hash function to use, one of MD5,\n SHA256, SHA512, Base64\n- **architecture**\n- **name** Architecture name, maps to ``architecture.name``\n- **provisioning-template**\n- **name** Provisioning template name, maps to\n ``provisioning-template.name``\n- **medium**\n- \\_\\_ name\\_\\_ Medium name, maps to ``medium.name``\n- **partition-table**\n- **name** Ptable name, maps to ``partition-table.name``\n- **parameters**\n- \\_\\_ key\\_\\_ Additional OS settings in format 'keyname': 'keyvalue'\n\nSection ``hostgroup``\n^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n hostgroup:\n - name: switzerland\n parent:\n environment: production\n os: Ubuntu 14.04 LTS\n architecture: x86_64\n medium: Ubuntu Mirror\n partition-table: Ubuntu Default\n subnet: lab\n domain: lab.local\n parameters:\n - keyname: keyvalue\n\n- **name** Hostgroup name\n- **parent** Parent hostgroup\n- **environment** Environment name, maps to ``environment.name``\n- **os** Operating system name, maps to ``os.name``\n- **architecture** Architecture name, maps to ``architecture.name``\n- **medium** Media name, maps to ``medium.name``\n- **partition-table** Ptable name, maps to ``partition-table.name``\n- **subnet** Subnet name, maps to ``subnet.name``\n- **domain** Domain name, maps to ``domain.name``\n- **parameters** Dict of params -**keyname** Value of param\n\nSection ``host``\n^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n host:\n - name: testhost\n domain: lab.local\n architecture: x86_64\n hostgroup: switzerland\n environment: production\n os: Ubuntu 14.04 LTS\n media: Ubuntu Mirror\n partition: Ubuntu Default\n model: VMWare VM\n mac: 00:11:22:33:44:55\n root-pass: supersecret42\n parameters:\n env: prod\n kernel_params: quiet\n\n- **name** Host name\n- **domain** Domain name, maps to ``domain.name``\n- **architecture** Architecture name, maps to ``architecture.name``\n- **hostgroup** Hostgroup name, maps to ``hostgroup.name``\n- **environment** Environment name, maps to ``environment.name``\n- **os** Operating system name, maps to ``os.name``\n- **media** Media name, maps to ``medium.name``\n- **partition** Ptable name, maps to ``partition.name``\n- **model** Hardware model name, maps to ``model.name``\n- **mac** MAC address\n- **root-pass** Root password\n- **parameters** Dict of params\n- **keyname** Value of param\n\nSection ``roles``\n^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n roles:\n - name: testrole\n permissions:\n architecture:\n - view_architectures\n - edit_architectures\n compute_resources:\n - view_compute_resources\n - create_compute_resources\n - destroy_compute_resources\n\n- **name** Role name\n- **permissions**\n- **groupname** Name of permission group (not applied to foreman), only\n for clarity\n\n - **permission\\_name** Permission name, maps to ``permission.name``\n - **permission\\_name** Permission name, maps to ``permission.name``\n - **permission\\_name** Permission name, maps to ``permission.name``\n - ... ...\n\nSection ``users``\n^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n users:\n - login: testhaaaans\n password: schmetterling42\n mail: haaaans@example.com\n auth-source: ldap-is-not-web-scale\n firstname: Test\n lastname: Haaaaaans\n admin: true\n timezone: UTC\n locale: en\n\n- **login** User login\n- **password** Password of user\n- **auth-source** Name of auth source or 'INTERNAL' for foreman-own\n auth source\n- **firstname** First name of user\n- **lastname** Last name of user\n- **admin** If ``true``, user will be created with admin permissions\n- **timezone** Timezone for the user\n- **locale** WebUI locale for the user\n\nSection ``usergroups``\n^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n usergroups:\n - name: api-test2\n admin: false\n users:\n - name: foo\n - name: burlson\n groups:\n - name: api-testgroup\n ext-usergroups:\n - name: foremangroup\n auth-source-ldap: ldap-is-not-web-scale\n roles:\n - name: foo\n\n- **name** Usergroup name\n- **admin** If set to true or 1, group is has admin permissions\n- **users** List of users\n- **name** Username, maps to ``users.name``\n- **groups** List of groups\n- **name** Groupname, maps to ``usergroups.name``\n- **ext-usergroups** List of external usergroups\n- **name** Name of the external usergroup\n- **auth-source-ldap** Name of the external auth source, maps to\n ``auth-source-ldap.name``\n- **roles** List of roles\n- **name** Role name, maps to ``role.name``\n\nSection ``auth-source-ldap``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n auth-source-ldap:\n - name: ldap-is-not-web-scale\n host: 10.11.12.13\n port: 389\n account: uid=binduser,cn=users,dc=test,dc=example,dc=com\n account-password: 123qwe\n base-dn: dc=test,dc=example,dc=com\n attr-login: uid\n attr-firstname: firstName\n attr-lastname: lastName\n attr-mail: mail\n attr-photo: picture\n onthefly-register: false\n usergroup-sync: false\n tls: false\n groups-base: cn=groups,dc=test,dc=example,dc=com\n ldap-filter:\n server-type: posix\n\n- **name** Name of the authsource\n- **host** LDAP host\n- **port** Server port\n- **account** Bind account user\n- **account-password** Bind account password\n- **base-dn** LDAP Base DN\n- **attr-login** LDAP attribute for username, required if\n onthefly-register is true\n- **attr-firstname** LDAP attribute for first name, required if\n onthefly-register is true\n- **attr-lastname** LDAP attribute for last name, required if\n onthefly-register is true\n- **attr-mail** LDAP attribute for mail, required if onthefly-register\n is true\n- **attr-photo** LDAP attribute for user photo\n- **onthefly-register** Register users on the fly if ``true`` or ``1``\n- **usergroup-sync** Sync external user groups on login if ``true`` or\n ``1``\n- **tls** If ``true`` or ``1``, use SSL to connect to the server\n- **groups-base** groups base DN\n- **ldap-filter** LDAP filter\n- **server-type** LDAP Server type, valid are ``free_ipa``,\n ``active_directory`` and ``posix``\n\nCleanup (delete) settings\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf the keyword ``cleanup`` is provided to foreman-yml, it will try to\ndelete items specified by its name.\n\n::\n\n foreman-yml cleanup /path/to/config.yml\n\nSection ``cleanup-[architecture|compute-profile|partition-table|provisioning-template]``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code:: yaml\n\n cleanup-[architecture|compute-profile|partition-table|provisioning-template]:\n - name: foo\n - name: bar\n\nRemoves specified objects, mapping to object.name - **name**\narchitecture\\|compute-profile\\|partition-table\\|provisioning-template\nname to delete\n\nHacking\n-------\n\n::\n\n virtualenv --system-site-packages venv-dev\n source venv-dev/bin/activate\n pip install -e .\n\nFuture\n------\n\n- Dump current settings\n- Better documentaion\n\nLicense\n-------\n\nGNU GENERAL PUBLIC LICENSE Version 3\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/adfinis-sygroup/foreman-yml", "keywords": "foreman,yaml,api", "license": "", "maintainer": "", "maintainer_email": "", "name": "foreman-yml", "package_url": "https://pypi.org/project/foreman-yml/", "platform": "", "project_url": "https://pypi.org/project/foreman-yml/", "project_urls": { "Homepage": "https://github.com/adfinis-sygroup/foreman-yml" }, "release_url": "https://pypi.org/project/foreman-yml/1.0.4/", "requires_dist": [ "python-foreman", "pyyaml", "requests" ], "requires_python": "", "summary": "Foreman YAML client", "version": "1.0.4" }, "last_serial": 3798533, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4a6ffd88186c3dfa127b32eb848fd1e3", "sha256": "c298746114bb240ea90c6d37fd2effdbdaf6ca9529f6fa78ee9f5051e0ddfdd5" }, "downloads": -1, "filename": "foreman-yml-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4a6ffd88186c3dfa127b32eb848fd1e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33070, "upload_time": "2017-01-24T14:35:50", "url": "https://files.pythonhosted.org/packages/7c/ce/de7ed318e9f818f7250bee810387532218297ecd4fd6fdec546d17e1d626/foreman-yml-1.0.0.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "15a7f4b861f0adb51d340efc8558df27", "sha256": "0fd840341c4e38e3be3d096f50d44f3a7d897eccc95c7f705427aec38ed854ed" }, "downloads": -1, "filename": "foreman-yml-1.0.2.tar.gz", "has_sig": false, "md5_digest": "15a7f4b861f0adb51d340efc8558df27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33479, "upload_time": "2017-02-23T09:25:39", "url": "https://files.pythonhosted.org/packages/d4/d4/c4b294d3bab0e959c63c17df8140d7d062584feebf88bdc971fe940e9a27/foreman-yml-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "68bf61cdc3ccb9a329b0e690a2371958", "sha256": "dbdc64d7ce2ef9760a9dc88f8e70cb078ea55f2366a4fc6b5c9f44f0e3e36f4c" }, "downloads": -1, "filename": "foreman_yml-1.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "68bf61cdc3ccb9a329b0e690a2371958", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 40305, "upload_time": "2017-06-19T10:56:06", "url": "https://files.pythonhosted.org/packages/a6/42/306e6370da1af726c55ac23bbd45544c148ce6fa682512d5d584b05e329b/foreman_yml-1.0.3-py2-none-any.whl" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "629992ac87c964da64d0116e689abb1b", "sha256": "203b966dccf71f5ce613bebe86470ce81238b727609c80d342ed2940b41efb12" }, "downloads": -1, "filename": "foreman_yml-1.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "629992ac87c964da64d0116e689abb1b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 40303, "upload_time": "2017-06-19T10:58:55", "url": "https://files.pythonhosted.org/packages/b1/6c/d7711a0e36374c9652755ada1ee9dbba2c3e6583a866648cdbc8b987ceb4/foreman_yml-1.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c48e6a5d79f9eb1a66fbb64c60b80f8", "sha256": "7ed873a4821381e2227747d178b5fcd06b2fb48769cb29d1c8aef860cb7ddebd" }, "downloads": -1, "filename": "foreman-yml-1.0.4.tar.gz", "has_sig": false, "md5_digest": "4c48e6a5d79f9eb1a66fbb64c60b80f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33730, "upload_time": "2017-06-19T10:58:57", "url": "https://files.pythonhosted.org/packages/30/bd/fc3d034c44c31d94e1758c742bb2ef918276f0175e88b476f57b78012810/foreman-yml-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "629992ac87c964da64d0116e689abb1b", "sha256": "203b966dccf71f5ce613bebe86470ce81238b727609c80d342ed2940b41efb12" }, "downloads": -1, "filename": "foreman_yml-1.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "629992ac87c964da64d0116e689abb1b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 40303, "upload_time": "2017-06-19T10:58:55", "url": "https://files.pythonhosted.org/packages/b1/6c/d7711a0e36374c9652755ada1ee9dbba2c3e6583a866648cdbc8b987ceb4/foreman_yml-1.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c48e6a5d79f9eb1a66fbb64c60b80f8", "sha256": "7ed873a4821381e2227747d178b5fcd06b2fb48769cb29d1c8aef860cb7ddebd" }, "downloads": -1, "filename": "foreman-yml-1.0.4.tar.gz", "has_sig": false, "md5_digest": "4c48e6a5d79f9eb1a66fbb64c60b80f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33730, "upload_time": "2017-06-19T10:58:57", "url": "https://files.pythonhosted.org/packages/30/bd/fc3d034c44c31d94e1758c742bb2ef918276f0175e88b476f57b78012810/foreman-yml-1.0.4.tar.gz" } ] }