Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap bug fixes & minor tidy-ups #9

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Overview
# irix_ansible

Configures an already-installed IRIX system.

# Requirements
## Requirements

* Host with ansible installed
* IRIX target host with telnet available

# Usage:

## Usage

Make a new file ~/.vault_pass.txt with your vault password in it. If your password is 'password', the file will only contain 'password'.

Delete group_vars/default/vault.yml , and make your own file that looks like this:
Expand All @@ -18,46 +19,49 @@ su_password: your_passwd
```

Then encrypt it:

```
ansible-vault encrypt group_vars/default/vault.yml --vault-password-file ~/.vault_pass.txt
```

Examine and modify the inventory.yml file (in the top level directory) to match your local requirements.

Run the bootstrap playbook on a system that has just been installed. It expects the root password to be blank.
Run the bootstrap playbook on a system that has just been installed. It expects the root password to be blank.

This playbook will:

This playbook will
* create an 'ansible' user
* copy several bundles via ftp
* install wget, python, and openssh
* start sshd
* create an 'ansible' user
* copy several bundles via ftp
* install wget, python, and openssh
* start sshd

```
ansible-playbook -i inventory.yml bootstrap.yml --vault-password-file ~/.vault_pass.txt
```

Examine and modify the master_setup playbook to your liking, then run it. You can comment out unneeded roles.

The master_setup playbook currently
* installs nekodeps
* installs base packages
* sets up bash as an available shell
* adds a user
* enables remote x11
* configures ntp
* installs findutils
* performs security hardening
The master_setup playbook currently:

* installs nekodeps
* installs base packages
* sets up bash as an available shell
* adds a user
* enables remote x11
* configures ntp
* installs findutils
* performs security hardening

```
ansible-playbook -i inventory.yml -u ansible master_setup.yml -k --become-method=su --vault-password-file ~/.vault_pass.txt
```
When prompted for "SSH password", enter 'ansible'.

When prompted for "SSH password", enter 'ansible'.

## Reading

# Reading
http://www.sillypages.org/sgi
http://nixdoc.net/man-pages/irix/man1/pwconv.1.html
<http://www.sillypages.org/sgi>
<http://nixdoc.net/man-pages/irix/man1/pwconv.1.html>

https://techpubs.jurassic.nl/manuals/0650/admin/IA_ConfigOps/sgi_html/index.html
https://techpubs.jurassic.nl/manuals/0650/admin/IA_ConfigOps/sgi_html/ch05.html#LE15895-PARENT
<https://techpubs.jurassic.nl/manuals/0650/admin/IA_ConfigOps/sgi_html/index.html>
<https://techpubs.jurassic.nl/manuals/0650/admin/IA_ConfigOps/sgi_html/ch05.html#LE15895-PARENT>
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[defaults]
remote_tmp = /tmp/.ansible/tmp
stdout_callback = debug
timeout = 300
timeout = 300
2 changes: 1 addition & 1 deletion ansible_role_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This is an example structure for a role.

To make a new role, cp -Ra this directory to roles/your_new_role , and use its structure.
To make a new role, cp -Ra this directory to roles/your_new_role , and use its structure.
1 change: 1 addition & 0 deletions ansible_role_example/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
name: bootstrap
vars_files:
- group_vars/default/vault.yml

vars:
ansible_become_pass: '{{ su_password }}'

6 changes: 3 additions & 3 deletions master_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- import_role:
name: setup_bash
- import_role:
name: openssh
name: openssh
# - import_role:
# name: user_setup
- import_role:
Expand All @@ -29,6 +29,6 @@
name: security
vars_files:
- group_vars/default/vault.yml

vars:
ansible_become_pass: '{{ su_password }}'
ansible_become_pass: '{{ su_password }}'
6 changes: 3 additions & 3 deletions remote_x11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
become_user: root
tasks:
- import_role:
name: remote_x11
name: remote_x11
vars_files:
- group_vars/default/vault.yml

vars:
ansible_become_pass: '{{ su_password }}'
ansible_become_pass: '{{ su_password }}'
4 changes: 2 additions & 2 deletions roles/base_pkgs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
- unzip

- name: nekodeps results
debug:
msg: "{{ nekodeps_output }}"
debug:
msg: "{{ nekodeps_output }}"
2 changes: 1 addition & 1 deletion roles/base_x/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
ignore_errors: true
- name: start xdm
command: /etc/init.d/xdm start
become: true
become: true
2 changes: 1 addition & 1 deletion roles/bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This is an example structure for a role.

To make a new role, cp -Ra this directory to roles/your_new_role , and use its structure.
To make a new role, cp -Ra this directory to roles/your_new_role , and use its structure.
2 changes: 1 addition & 1 deletion roles/bootstrap/files/openssh_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cd /tmp/openssh_bundle

inst -E -a -f /tmp/openssh_bundle/neko_openssh-6.2p1.tardist \
-a -f /tmp/openssh_bundle/neko_openssl-0.9.8x.tardist \
-a -f /tmp/openssh_bundle/neko_zlib-1.2.5.tardist
-a -f /tmp/openssh_bundle/neko_zlib-1.2.5.tardist
2 changes: 1 addition & 1 deletion roles/bootstrap/files/python_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ cd /tmp/python_bundle
-a -f neko_zlib-1.2.5.tardist \
-a -f neko_glib-2.28.8-11.tardist \
-a -f neko_libcroco-0.6.2-5.tardist \
-a -f neko_libxml2-2.7.8.tardist
-a -f neko_libxml2-2.7.8.tardist
2 changes: 1 addition & 1 deletion roles/bootstrap/files/wget_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ inst -E -a -f neko_wget-1.11.3.tardist \
-a -f neko_libxml2-2.7.8.tardist \
-a -f neko_ncurses-5.7.tardist \
-a -f neko_openssl-0.9.8x.tardist \
-a -f neko_zlib-1.2.5.tardist
-a -f neko_zlib-1.2.5.tardist
10 changes: 5 additions & 5 deletions roles/bootstrap/tasks/add_ansible_user.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: Create ansible user
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -10,13 +10,13 @@
register: userout

- name: print output
debug:
debug:
msg: "{{ userout.output }}"

- name: Set password for ansible user
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -25,5 +25,5 @@
register: pwout

- name: print output
debug:
msg: "{{ pwout.output }}"
debug:
msg: "{{ pwout.output }}"
16 changes: 8 additions & 8 deletions roles/bootstrap/tasks/extract_bundles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: extract openssh bundle
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -10,13 +10,13 @@
register: bundleout

- name: print output
debug:
debug:
msg: "{{ bundleout }}"

- name: extract wget bundle
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -26,12 +26,12 @@


- name: print output
debug:
debug:
msg: "{{ bundleout }}"
- name: extract python bundle
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -41,5 +41,5 @@


- name: print output
debug:
msg: "{{ bundleout }}"
debug:
msg: "{{ bundleout }}"
2 changes: 1 addition & 1 deletion roles/bootstrap/tasks/fetch_bundles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: download neko bootstrap tarball from remote repo
# this now fetches one tarball with all the neko packages
become: no
get_url:
get_url:
url: "{{ fetchfrom }}/sgi-irix/nekobootstrap/{{ item }}"
dest: "roles/bootstrap/files/{{ item }}"
delegate_to: 127.0.0.1
Expand Down
26 changes: 13 additions & 13 deletions roles/bootstrap/tasks/install_bundles.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: Clean up /var/tmp
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -12,7 +12,7 @@
- name: create /usr/nekoware
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -24,7 +24,7 @@
- name: telnet as root and untar the nekoware tarball into /usr/nekoware/dist
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
Expand All @@ -33,7 +33,7 @@
register: tarout

- name: print tarout
debug:
debug:
msg: "{{ tarout.output }}"


Expand All @@ -52,13 +52,13 @@
- name: install openssh bundle
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
command:
- "/sbin/sh /usr/nekoware/dist/openssh_install.sh"
when: sshversion.output | select('search','OpenSSH') | list | count < 0
when: sshversion.output | select('search','OpenSSH') | list | count == 0

- name: Verify openssh
telnet:
Expand All @@ -78,7 +78,7 @@
- name: Quit if OpenSSH failed to install properly
fail:
msg: "OpenSSH failed to install properly. Telnet to your SGI and install it manually, then re-run this play."
when: sshversion.output | select('search','OpenSSH') | list | count < 0
when: sshversion.output | select('search','OpenSSH') | list | count == 0
# per debug, telnet's output is a list. We have to select search it, then count it.

##################################################
Expand All @@ -96,15 +96,15 @@
- name: install wget bundle
telnet:
user: root
password:
password:
login_prompt: "login: "
prompts:
- "[>|#]"
command:
- "/sbin/sh /usr/nekoware/dist/wget_install.sh"
timeout: 300
when: wgetversion.output | select('search','Wget') | list | count < 0
when: wgetversion.output | select('search','Wget') | list | count == 0


- name: Verify wget
telnet:
Expand All @@ -124,7 +124,7 @@
- name: Quit if wget failed to install properly
fail:
msg: "wget failed to install properly. Telnet to your SGI and install it manually, then re-run this play."
when: wgetversion.output | select('search','Wget') | list | count < 0
when: wgetversion.output | select('search','Wget') | list | count == 0
# per debug, telnet's output is a list. We have to select search it, then count it.

##################################################
Expand All @@ -149,7 +149,7 @@
timeout: 300
command:
- "/sbin/sh /usr/nekoware/dist/python_install.sh"
when: pyversion.output | select('search','Python') | list | count < 0
when: pyversion.output | select('search','Python') | list | count == 0


- name: Verify python
Expand All @@ -170,5 +170,5 @@
- name: Quit if Python failed to install properly
fail:
msg: "Python failed to install properly. Telnet to your SGI and install it manually, then re-run this play."
when: pyversion.output | select('search','Python') | list | count < 0
when: pyversion.output | select('search','Python') | list | count == 0
# per debug, telnet's output is a list. We have to select search it, then count it.
Loading