{"id":15705317,"url":"https://github.com/brahmlower/ansible-factorio","last_synced_at":"2025-04-30T11:40:53.751Z","repository":{"id":86081439,"uuid":"89881918","full_name":"brahmlower/ansible-factorio","owner":"brahmlower","description":"A role for creating Factorio servers","archived":false,"fork":false,"pushed_at":"2023-12-15T16:40:20.000Z","size":43,"stargazers_count":4,"open_issues_count":5,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T17:17:25.644Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/bplower/factorio/","language":"Makefile","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/brahmlower.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-30T22:48:43.000Z","updated_at":"2023-12-15T16:40:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c78996c-8e55-4a7e-b8f0-2f9fb01658a6","html_url":"https://github.com/brahmlower/ansible-factorio","commit_stats":{"total_commits":33,"total_committers":4,"mean_commits":8.25,"dds":0.2727272727272727,"last_synced_commit":"13b294263ce5d9a90061dbfa68803a4d91ae29d6"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahmlower%2Fansible-factorio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahmlower%2Fansible-factorio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahmlower%2Fansible-factorio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brahmlower%2Fansible-factorio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brahmlower","download_url":"https://codeload.github.com/brahmlower/ansible-factorio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246342713,"owners_count":20761938,"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":[],"created_at":"2024-10-03T20:15:24.829Z","updated_at":"2025-03-30T15:43:30.991Z","avatar_url":"https://github.com/brahmlower.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Factorio\n\n[![Install from Ansible Galaxy](https://img.shields.io/badge/role-bplower.factorio-blue.svg)](https://galaxy.ansible.com/bplower/factorio/)\n![Ansible Lint](https://github.com/bplower/ansible-factorio/workflows/Ansible%20Tests/badge.svg)\n\nA role for creating Factorio servers\nhttps://galaxy.ansible.com/bplower/factorio/\n\n## Requirements\n\nNo requirements\n\n## Role Variables\n\nVariables can be roughly divided into two groups: deployment configurations and\nFactorio configurations.\n\n### Deployment Configurations\n\nThe deployment configurations are all related to the way in which ansible\ninstalls the factorio server. These should be abstracted enough to allow\nmultiple factorio servers to be run simultaneously.\n\n```\nserver_sources: \"/opt/games/sources/factorio\"\nserver_version: \"0.17.79\"\ndownload_url: \"https://www.factorio.com/get-download/{{ server_version }}/headless/linux64\"\nservice_name: \"factorio-server\"\nservice_user: \"factorio\"\nservice_group: \"factorio\"\nservice_root: \"/home/{{ service_user }}\"\nservice_port: 34197\nservice_restart_permitted: true\nfactorio_default_save: \"{{ service_root }}/factorio/saves/default-save.zip\"\nfactorio_target_save: \"{{ factorio_default_save }}\"\n```\n\nMore detailed information about these variables is as follows:\n\n- Variable: `server_sources`\u003cbr\u003e\n  Default: `\"/opt/games/sources/factorio\"`\u003cbr\u003e\n  Comments: \u003cbr\u003e\n  Where to cache server binaries downloaded from the download_url\n\n- Variable: `server_version`\u003cbr\u003e\n  Default: `\"0.17.79\"`\u003cbr\u003e\n  Choices:\n  - \"0.18.26\"\n  - \"0.17.79\"\n  - \"0.17.74\"\n  - \"0.16.51\"\n  - \"0.15.40\"\n  - \"0.14.23\"\n  - \"0.13.20\"\n  - \"0.12.35\"\n\n  Comments:\u003cbr\u003e\n   You must set the `download_checksum` value if you set this variable. This\n   value is used in the default `download_url`.\n\n- Variable: `download_url`\u003cbr\u003e\n  Default: `\"https://www.factorio.com/get-download/{{ server_version }}/headless/linux64\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The URL to download the server binary from. This will only be downloaded if\n  the path `\"{{ server_sources }}/factorio-{{ server_version }}.tar.gz\"` does\n  not exist.\n\n- Variable: `download_checksum`\u003cbr\u003e\n  Default: `\"sha256:9ace12fa986df028dc1851bf4de2cb038044d743e98823bc1c48ba21aa4d23df\"`\n  Comments:\u003cbr\u003e\n  The checksum that must match the downloaded server binary. This ensures the integrity.\n  If you change the `download_url` or `server_version`, you need to adapt the checksum as well. To get the\n  checksum of a server binary, you can use `curl --silent --location \u003cdownload_url\u003e | sha256sum`.\n  To disable the checksum verification, just set it to an empty string (`\"\"`).\n\n- Variable: `service_name`\u003cbr\u003e\n  Default: `\"factorio-server\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The name of the service to create. Multiple instances of factorio servers can\n  be run on a single host by providing different values for this variable (See\n  the examples section of this document).\n\n- Variable: `service_user`\u003cbr\u003e\n  Default: `\"factorio\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The user the service should be run as.\n\n- Variable: `service_group`\u003cbr\u003e\n  Default: `\"factorio\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The group the service user should be a member of.\n\n- Variable: `service_root`\u003cbr\u003e\n  Default: `\"/home/{{ service_user }}\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The directory in which to store the contents of the factorio zip file\n  downloaded from the server. This will result in the factorio resources being\n  stored at `{{ service_root }}/factorio/`.\n\n- Variab: `service_port`\u003cbr\u003e\n  Default: `34197`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The port to host the service on. This default is the factorio default value.\n\n- Variable: `service_restart_permitted`\u003cbr\u003e\n  Default: `true`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  Setting this to `false` will prevent the service from being restarted if\n  changes were applied. This allows settings to be applied in preparation for\n  the next service restart without immediately causing service interruption.\n\n- Variable: `factorio_default_save`\u003cbr\u003e\n  Default: `\"{{ service_root }}/factorio/saves/default-save.zip\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The default save file used by the server.\n\n- Variable: `factorio_target_save`\u003cbr\u003e\n  Default: `\"{{ factorio_default_save }}\"`\u003cbr\u003e\n  Comments:\u003cbr\u003e\n  The save file to be run by the server. This distinction is provided to\n  facilitate switching between multiple save files.\n\n### Factorio Configurations\n\nSettings for various config files can be set in dictionaries loosely named after\nthe file. Each dictionary starts with `factorio_` followed by the filename\n(excluding the filetype extension) where hyphens ( - ) are replaced by\nunderscores ( _ ). For example, the `server-settings.json` file is associated\nwith the dictionary variable `factorio_server_settings`.\n\nThe `default/` folder contains serveral files showing example dictionaries\nrepresenting the values provided by the Factorio servers various examples JSON\nfiles.\n\nThe following is a list of config files that have been implemented:\n\n- Filename: `server-settings.json`\u003cbr\u003e\n  Variable: `factorio_server_settings`\u003cbr\u003e\n  Example:\n  ```\n  factorio_server_settings:\n    name: \"My Public Server\"\n    max_players: 10\n    game_password: \"mypassword\"\n    visibility:\n      public: true\n      lan: true\n  ```\n\n- Filename: `server-whitelist.json`\u003cbr\u003e\n  Variable: `factorio_server_whitelist`\u003cbr\u003e\n  Example:\n  ```\n  factorio_server_whitelist:\n  - Oxyd\n  ```\n\n- Filename: `map-settings.json`\u003cbr\u003e\n  Variable: `factorio_map_settings`\u003cbr\u003e\n  Example:\n  ```\n  factorio_map_settings:\n    pollution:\n      enabled: false\n  ```\n\n- Filename: `map-gen-settings.json`\u003cbr\u003e\n  Variable: `factorio_map_gen_settings`\u003cbr\u003e\n  Example:\n  ```\n  factorio_map_gen_settings:\n    water: \"high\"\n    autoplace_controles:\n      coal:\n        size: \"very-low\"\n  ```\n\n## Example Playbooks\n\nAn out of the box example might look as follows:\n\n```\n---\n- name: Create a default factorio server\n  hosts: localhost\n  roles:\n  - role: bplower.factorio\n```\n\nAn example with a non-default port, and customized name:\n```\n---\n- name: My slightly changed factorio server\n  hosts: localhost\n  roles:\n  - role: bplower.factorio\n    service_port: 12345\n    factorio_server_settings:\n      name: \"My factorio server\"\n```\n\nAn example of multiple servers on a single host:\n```\n---\n- name: Factorio farm\n  hosts: localhost\n  roles:\n  - role: bplower.factorio\n    service_port: 50001\n    service_name: factorio_1\n    service_root: /home/{{ service_user }}/{{ service_name }}\n  - role: bplower.factorio\n    service_port: 50002\n    service_name: factorio_2\n    service_root: /home/{{ service_user }}/{{ service_name }}\n```\n\n## License\n\nGNU GPLv3\n\n# Development \u0026 Contributions\n\nI don't use this project regularly anymore, but I try to keep it up to date when\npossible. If you have any issues or questions about it, I encourage you to open\na PR or issue.\n\n## Testing\n\nThis role uses yamllint for yaml validation, and molecule + docker for testing.\nBoth tools can be installed using the `dev-requirements.txt` file. You will need\nto install docker separately.\n\n```\npip install -r dev-requirements.txt`\n```\n\nGrouping all supported platforms together caused issues for CI, so the test are\nsplit into 3 scenarios based on the platforms being tested.\n\nThe makefile can be used to start each of the tests, and supports a helpmenu with\ndescriptions for each target:\n\n```\n$ make help\n\nUsage:\n  make\n\nTargets:\n  help        Display this help\n  lint        Lint yaml files\n  test_all    Run all molecule tests\n  test_centos  Run molecule centos tests\n  test_debian  Run molecule debian tests\n  test_ubuntu  Run molecule ubuntu tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrahmlower%2Fansible-factorio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrahmlower%2Fansible-factorio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrahmlower%2Fansible-factorio/lists"}