generated from oracle-devrel/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from bgraef/main
add bits for olam ipa and oci collection labs
- Loading branch information
Showing
8 changed files
with
187 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
# Copyright (c) 2024 Oracle and/or its affiliates. | ||
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0. | ||
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl) | ||
# See LICENSE.TXT for details. | ||
|
||
- name: Setup freeipa server using a role | ||
hosts: ipa-server | ||
become: true | ||
vars: | ||
ipaserver_domain: "{{ ansible_domain }}" | ||
ipaserver_realm: "{{ ansible_domain|upper }}" | ||
ipaserver_setup_dns: false | ||
ipaadmin_password: ADMPassword1 | ||
ipadm_password: DMPassword1 | ||
|
||
roles: | ||
- role: freeipa.ansible_freeipa.ipaserver | ||
state: present | ||
|
||
# - name: Setup freeipa server manually on ol8 | ||
# hosts: ipa-server | ||
# become: yes | ||
# vars: | ||
# ipaserver_domain: "{{ ansible_domain }}" | ||
# ipaserver_realm: "{{ ansible_domain|upper }}" | ||
# ipaserver_setup_dns: no | ||
# ipaadmin_password: ADMPassword1 | ||
# ipadm_password: DMPassword1 | ||
|
||
# tasks: | ||
|
||
# - name: Set firewall rules for freeipa | ||
# ansible.posix.firewalld: | ||
# zone: public | ||
# service: "{{ item }}" | ||
# permanent: yes | ||
# state: enabled | ||
# immediate: yes | ||
# loop: | ||
# - freeipa-4 | ||
|
||
# - name: Enable the idm DL1 module stream | ||
# ansible.builtin.dnf: | ||
# name: '@idm:DL1' | ||
# state: present | ||
# when: | ||
# - ansible_distribution == 'OracleLinux' and ansible_distribution_major_version == '8' | ||
|
||
# - name: Install freeipa packages and dependencies | ||
# ansible.builtin.dnf: | ||
# name: | ||
# - ipa-server | ||
# state: latest | ||
|
||
# - name: Copy script | ||
# ansible.builtin.template: | ||
# src: templates/install.j2 | ||
# dest: /root/install.sh | ||
# mode: '0755' | ||
|
||
# - name: Install the freeipa server | ||
# #ansible.builtin.shell: ipa-server-install -r {{ ipaserver_realm | quote }} -p {{ ipadm_password | quote }} -a {{ ipaadmin_password | quote }} -U | ||
# shell: /root/install.sh | ||
# register: freeipa_install | ||
|
||
# - name: Output from freeipa install | ||
# ansible.builtin.debug: | ||
# msg: "{{ freeipa_install.stdout }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
# Copyright (c) 2024 Oracle and/or its affiliates. | ||
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0. | ||
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl) | ||
# See LICENSE.TXT for details. | ||
|
||
- name: Configure a git server | ||
hosts: git-server | ||
become: true | ||
vars: | ||
ssh_key_params: "no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty " | ||
private_key: "id_rsa" | ||
|
||
tasks: | ||
|
||
- name: Add git user | ||
ansible.builtin.user: | ||
name: git | ||
comment: standard git user | ||
|
||
- name: Set authorized key for git access using local pubilc key file | ||
ansible.posix.authorized_key: | ||
user: git | ||
state: present | ||
key: "{{ ssh_key_params ~ lookup('file', lookup('env', 'HOME') + '/.ssh/' + private_key + '.pub') }}" | ||
|
||
- name: Install git | ||
ansible.builtin.dnf: | ||
name: git | ||
state: present | ||
|
||
- name: Create new repo on the git server | ||
ansible.builtin.file: | ||
path: /git-server/repos/hello-world.git | ||
owner: git | ||
group: git | ||
state: directory | ||
mode: "0755" | ||
|
||
- name: Set git default branch | ||
community.general.git_config: | ||
name: init.defaultBranch | ||
scope: global | ||
value: main | ||
|
||
- name: Initialize a bare repo | ||
ansible.builtin.shell: | | ||
git init --bare | ||
args: | ||
chdir: /git-server/repos/hello-world.git/ | ||
become: true | ||
become_user: git | ||
register: git_results | ||
changed_when: git_results.rc != 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
/usr/sbin/ipa-server-install -r {{ ipaserver_realm | quote }} -p {{ ipadm_password | quote }} -a {{ ipaadmin_password | quote }} -U |