{"id":15692915,"url":"https://github.com/code-hex/setup-pi","last_synced_at":"2025-07-08T01:11:03.855Z","repository":{"id":71654993,"uuid":"101380042","full_name":"Code-Hex/setup-pi","owner":"Code-Hex","description":"Quickly setup your Raspberry Pi","archived":false,"fork":false,"pushed_at":"2017-08-26T06:31:22.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T12:43:39.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/Code-Hex.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-08-25T07:50:48.000Z","updated_at":"2017-08-25T07:52:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"b6912811-40f2-435c-ac20-2596f47de228","html_url":"https://github.com/Code-Hex/setup-pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Code-Hex/setup-pi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2Fsetup-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2Fsetup-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2Fsetup-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2Fsetup-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Code-Hex","download_url":"https://codeload.github.com/Code-Hex/setup-pi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Code-Hex%2Fsetup-pi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264171993,"owners_count":23567797,"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-03T18:40:38.573Z","updated_at":"2025-07-08T01:11:03.837Z","avatar_url":"https://github.com/Code-Hex.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# setup-pi\n\n![](https://raw.github.com/motdotla/ansible-pi/master/ansible-pi.jpg)\n\nQuickly setup your Raspberry Pi.\n\n## How to use\n\nClone to your host computer\n\n```\ngo get https://github.com/Code-Hex/setup-pi.git\ncd $GOPATH/src/github/Code-Hex/setup-pi\n```\n\nAnd, we need [`go-bindata`](https://github.com/jteeuwen/go-bindata) to compile source code.\n\n```\ngo get -u github.com/jteeuwen/go-bindata/...\n```\n\nIf you are completed above flow, you can compile source code after put some files on the `files` directory. Files in the `files` directory are also compiled together, and a single binary file is created.\n\n```\nmake all\n```\n\n## How to write recipe\n\nYou must need to write `items` key at first line.  \nNext, you should write\n\n    - name: 'task name'\nper your task. The whole atmosphere will be as follows.\n```yaml\nitems:\n  - name: 'Configure WIFI'\n    copy:\n      src: ./conf/wpa_supplicant.conf\n      dest: /etc/wpa_supplicant/wpa_supplicant.conf\n      mode: 0600\n\n  - name: 'Install packages using apt'\n    apt:\n      packages:\n        - git\n        - openssl\n        - build-essential \n        - guvcview\n        - tightvncserver\n      before_update: True\n      is_upgrade: True\n\n  - name: 'Configure dhcpd'\n    copy:\n      src: ./conf/dhcpcd.conf\n      dest: /etc/dhcpcd.conf\n\n  - name: 'Configure autorun_date'\n    copy:\n      src: ./init.d/autorun_date\n      dest: /etc/init.d/autorun_date\n      mode: 0755\n\n  - name: 'Register autorun_date to update-rc.d'\n    command: update-rc.d /etc/init.d/autorun_date defaults\n```\n\nYou can use these keys for the task.\n    \n    apt, copy, get_url, command\n\n### ・`apt`\n`apt` have `packages` and `before_update`.\n`packages` have value to install packages.  \n- `before_update`: Bool. It update repositories before do relate apt task.\n- `is_upgrade`: Bool. If you have the upgrade list, these will upgrade.\n\n```yaml\n- name: 'install using apt'\n  apt:\n    packages:\n      - git\n      - openssl\n      - build-essential \n      - guvcview\n      - tightvncserver\n    before_update: True # bool\n    is_upgrade: True    # bool\n```\n\n### ・`copy`\n`copy` have `src` and `dest`, `mode`.\nCopy the compiled file together to the specified path.\n- `src`: You specify the path as the base of `files` directory.  \n- `dest`: You specify destenetion path.\n- `mode`: permission.\n```yaml\n- name: 'Copy file'\n  copy:\n    src: ./init.d/autorun_date\n    dest: /etc/init.d/autorun_date\n    mode: 0755\n```\n### ・`get_url`\n`get_url` have `url` and `dest`.  \nYou can download file if you use this key.\n- `url`: Specify the URL.\n- `dest`: Specify the download destination.\n```yaml\n- name: 'Download rclone'\n   get_url:\n     url: \"https://downloads.rclone.org/rclone-v1.37-linux-arm.zip\"\n     dest: \"/home/pi/\"\n```\n### ・`command`\nYou can run command. like this.\n```yaml\n- name: 'run command'\n  command: echo Hello World\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fsetup-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-hex%2Fsetup-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-hex%2Fsetup-pi/lists"}