Skip to content
Snippets Groups Projects
Select Git revision
  • ac0d1cabee036e9e7d7ba1258fcf1f4fa675fb3a
  • main default
  • v0.3.1
  • v0.3.0
  • v0.2.0
  • v0.1.0
6 results

README.rst

Blame
    • nimrod's avatar
      ac0d1cab
      Version 0.2. · ac0d1cab
      nimrod authored
      Add the `TF_CLI` environment variable to use a different terraform
      binary (like opentofu) and some documentation.
      ac0d1cab
      History
      Version 0.2.
      nimrod authored
      Add the `TF_CLI` environment variable to use a different terraform
      binary (like opentofu) and some documentation.
    playbook.yml 2.41 KiB
    ---
    - hosts: gitreceive-openbsd*
      gather_facts: false
      roles:
          - openbsd-bootstrap
          - role: users
            users: []
            users_use_sudo: True
            users_lock_root_ssh: False
    
    - hosts: [gitreceive-xenial, gitreceive-wheezy]
      gather_facts: false
      roles:
          - debian-bootstrap
          - role: users
            users: []
            users_use_sudo: True
            users_lock_root_ssh: False
    
    - hosts: all
      tasks:
          - name: Create SSH keypair
            become: False
            local_action: command ssh-keygen -t rsa -N '' -f files/id_rsa
            run_once: True
            args:
                creates: files/id_rsa
    
          - name: Install SSH server
            when: ansible_pkg_mgr == 'apt'
            apt:
                name: openssh-server
                state: present
    
          - name: Create sshd run directory
            when: ansible_os_family == 'Debian'
            file:
                path: /var/run/sshd
                owner: root
                group: root
                mode: 0o0755
                state: directory
    
          - name: Start SSH service
            when: ansible_pkg_mgr == 'apt'
            service:
                name: ssh
                state: started
    
    - hosts: all
      roles:
          - role: gitreceive
            gitreceive_public_keys: ['{{ lookup("file", "id_rsa.pub") }}']
            gitreceive_receiver_script: '{{ lookup("file", "files/receiver.sh") }}'
      post_tasks:
          - name: Create .ssh directory
            file:
                path: /root/.ssh
                owner: root
                group: 0
                mode: 0o0700
                state: directory
    
          - name: Copy SSH keypair
            with_items:
                - id_rsa
                - id_rsa.pub
            copy:
                src: '{{ item }}'
                dest: '/root/.ssh/{{ item }}'