--- - name: GitLab Post | Install pip yum: name: python-pip state: present - name: GitLab Post | Install pyapi-gitlab pip: name: pyapi-gitlab - name: GitLab Post | Repos to create debug: msg: "https://gitlab.{{ dns_domain_name }}/{{ user_prefix }}/ansible-playbooks" - name: GitLab Post | copy root password script to host template: src: set_root_pw.sh.j2 dest: /root/set_root_pw.sh owner: root group: root mode: 0700 - name: GitLab Post | Execute set root password command: ./set_root_pw.sh args: chdir: /root - name: GitLab Post | Remove set root password script file: path: /root/set_root_pw.sh state: absent #TODO try new way from RM - name: sleep 2 minute to allow root to initialize after password set pause: minutes: 2 ### Gitlab workaround ### Users are not populated from AD until login from Web UI ### I haven't found an automated workaround... - block: - name: GitLab Post | Create local users gitlab_user: server_url: https://gitlab.{{ dns_domain_name }} validate_certs: False login_user: root login_password: "{{ windows_password }}" name: "{{ user_prefix }}" username: "{{ user_prefix }}" password: "{{ windows_password }}" email: "{{ user_prefix }}@{{ dns_domain_name }}" confirm: False state: present # - name: GitLab Post | Create Projects in GitLab # gitlab_project: # server_url: https://gitlab.{{ dns_domain_name }} # validate_certs: False # login_user: root # login_password: "{{ windows_password }}" # name: "{{ user_prefix }}" # group: "{{ user_prefix }}" # issues_enabled: False # wiki_enabled: False # snippets_enabled: False # state: present # ignore_errors: true when: ansible_version.full is version_compare('2.8', '<') # There seems to be an issue with using basic auth when using ansible 2.8 # Create users and projects with uri module using API endpoint - include_tasks: api.yml when: ansible_version.full is version_compare('2.8', '>=')