Overview
The Ansible playbooks for the REDFERN cluster are getting hard to manage manually. I decided to use Git Hub to manage the source repository.
References
Ubuntu Commands
GIT Commands
- Book
- Reference
- git-add - Add file contents to the index
- git-clone - Clone a repository into a new directory
- git-commit - Record changes to the repository
- git-init - Create an empty Git repository or reinitialize an existing one
- git-push - Update remote refs along with associated objects
- git-reset - Reset current HEAD to the specified state
- git-status - Show the working tree status
Procedure
Verify GIT is installed
On AUBURN , the installation of GIT was verified as follows:
which git
The output was:
/usr/bin/git
This means that the GIT command is available.
Create GITHUB Account and Repository
Created an account here .
Created an empty repository called ansible-ocm12c .
Initialize GIT Repository
Following the procedure in 2.1 Git Basics - Getting a Git Repository , I ran the following commands:
cd /etc/ansible/ git init
The output was:
Initialized empty Git repository in /etc/ansible/.git/
Cloned Empty Repository
Following the procedure in 2.1 Git Basics - Getting a Git Repository , I ran the following commands:
git clone https://github.com/dfhawthorne/ansible-ocm12c.git
The output was:
Cloning into 'ansible-ocm12c'... remote: Counting objects: 3, done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. Checking connectivity... done.
Moved Source Code into Cloned Repository
Ran the following commands to move the files to the cloned repository:
cd /etc/ansible mv roles ansible-ocm12c/ mv sites.yml ansible-ocm12c/
The hosts file has to remain in the /etc/ansible/ directory.
Check Status of Local Repository
Ran the following commands to check the status of the cloned repository:
cd /etc/ansible/ansible-ocm12c git status
The output was:
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) roles/ sites.retry sites.yml nothing added to commit but untracked files present (use "git add" to track)
Add Files to Local Repository
Ran the following commands to add files to the cloned repository:
cd /etc/ansible/ansible-ocm12c git add sites.yml git add roles/
Check Status of Local Repository
Ran the following commands to check the status of the cloned repository:
cd /etc/ansible/ansible-ocm12c git status
The output was:
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: roles/common/README.md new file: roles/common/defaults/main.yml new file: roles/common/handlers/main.yml new file: roles/common/meta/main.yml new file: roles/common/tasks/main.yml new file: roles/common/tests/inventory new file: roles/common/tests/test.yml new file: roles/common/vars/main.yml new file: roles/oracle_gi/README.md new file: roles/oracle_gi/defaults/main.yml new file: roles/oracle_gi/handlers/main.yml new file: roles/oracle_gi/meta/main.yml new file: roles/oracle_gi/tasks/gi_asm.yml new file: roles/oracle_gi/tasks/install_gi_sw.yml new file: roles/oracle_gi/tasks/main.yml new file: roles/oracle_gi/tasks/networks.yml new file: roles/oracle_gi/tasks/oracleasm.yml new file: roles/oracle_gi/tasks/oracleasm_init_disk.yml new file: roles/oracle_gi/templates/grid_install.rsp new file: roles/oracle_gi/tests/inventory new file: roles/oracle_gi/tests/test.yml new file: roles/oracle_gi/vars/main.yml new file: roles/oracle_user/README.md new file: roles/oracle_user/defaults/main.yml new file: roles/oracle_user/handlers/main.yml new file: roles/oracle_user/meta/main.yml new file: roles/oracle_user/tasks/install_dir.yml new file: roles/oracle_user/tasks/main.yml new file: roles/oracle_user/tasks/oracle_software_src.yml new file: roles/oracle_user/tasks/preinstall.yml new file: roles/oracle_user/tasks/user_groups.yml new file: roles/oracle_user/tests/inventory new file: roles/oracle_user/tests/test.yml new file: roles/oracle_user/vars/main.yml new file: roles/oracle_user/vars/oracle_pw.yml new file: sites.yml Untracked files: (use "git add <file>..." to include in what will be committed) sites.retry
Unfortunately, the file containing the hashed password for the oracle user was staged.
Unstage Oracle Password File
Ran the following commands to unstage the Oracle password file from the cloned repository:
cd /etc/ansible/ansible-ocm12c git reset HEAD roles/oracle_user/vars/oracle_pw.yml
Commit the Initial Build
Ran the following commands to commit the initial build:
cd /etc/ansible/ansible-ocm12c git commit
The output was:
[master 5b207e0] Initial push of Ansible playbooks with one (1) unresolved issue: (1) pexpect is not installed on REDFERN1 Committer: douglas <douglas@auburn.yaocm.id.au> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly. Run the following command and follow the instructions in your editor to edit your configuration file: git config --global --edit After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 35 files changed, 1143 insertions(+) create mode 100644 roles/common/README.md create mode 100644 roles/common/defaults/main.yml create mode 100644 roles/common/handlers/main.yml create mode 100644 roles/common/meta/main.yml create mode 100644 roles/common/tasks/main.yml create mode 100644 roles/common/tests/inventory create mode 100644 roles/common/tests/test.yml create mode 100644 roles/common/vars/main.yml create mode 100644 roles/oracle_gi/README.md create mode 100644 roles/oracle_gi/defaults/main.yml create mode 100644 roles/oracle_gi/handlers/main.yml create mode 100644 roles/oracle_gi/meta/main.yml create mode 100644 roles/oracle_gi/tasks/gi_asm.yml create mode 100644 roles/oracle_gi/tasks/install_gi_sw.yml create mode 100644 roles/oracle_gi/tasks/main.yml create mode 100644 roles/oracle_gi/tasks/networks.yml create mode 100644 roles/oracle_gi/tasks/oracleasm.yml create mode 100644 roles/oracle_gi/tasks/oracleasm_init_disk.yml create mode 100644 roles/oracle_gi/templates/grid_install.rsp create mode 100644 roles/oracle_gi/tests/inventory create mode 100644 roles/oracle_gi/tests/test.yml create mode 100644 roles/oracle_gi/vars/main.yml create mode 100644 roles/oracle_user/README.md create mode 100644 roles/oracle_user/defaults/main.yml create mode 100644 roles/oracle_user/handlers/main.yml create mode 100644 roles/oracle_user/meta/main.yml create mode 100644 roles/oracle_user/tasks/install_dir.yml create mode 100644 roles/oracle_user/tasks/main.yml create mode 100644 roles/oracle_user/tasks/oracle_software_src.yml create mode 100644 roles/oracle_user/tasks/preinstall.yml create mode 100644 roles/oracle_user/tasks/user_groups.yml create mode 100644 roles/oracle_user/tests/inventory create mode 100644 roles/oracle_user/tests/test.yml create mode 100644 roles/oracle_user/vars/main.yml create mode 100644 sites.yml
Push the Initial Build
Ran the following commands to push the initial build to the main repository:
git push --all
The output was:
Username for 'https://github.com': ********************************* Password for 'https://*********************************@github.com': Counting objects: 52, done. Compressing objects: 100% (31/31), done. Writing objects: 100% (52/52), 12.69 KiB | 0 bytes/s, done. Total 52 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), done. To https://github.com/dfhawthorne/ansible-ocm12c.git a837737..ba8aa47 master -> master