Created
November 17, 2016 17:19
-
-
Save adejoux/821fda9dcc10a6f2f931be9a914a57ac to your computer and use it in GitHub Desktop.
a simple ansible playbook to run initial customization on AIX.
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
--- | |
- hosts: aixtestlab | |
gather_facts: False | |
tasks: | |
- name: add group adejoux | |
group: name=adejoux state=present | |
- name: create user adejoux | |
user: name=adejoux comment="Alain Dejoux" uid=1000 group=adejoux | |
- name: generate ssh key for adejoux | |
user: name=adejoux generate_ssh_key=yes ssh_key_type=ecdsa ssh_key_file=.ssh/id_ecdsa ssh_key_bits=256 | |
- name: create logical volume lvroot | |
command: mklv -t jfs2 -y lvroot rootvg 1G | |
args: | |
creates: /dev/lvroot | |
- name: create logical volume lvtools | |
command: mklv -t jfs2 -y lvtools rootvg 1G | |
args: | |
creates: /dev/lvtools | |
- name: create filesystem /root | |
command: crfs -v jfs2 -A yes -m /root -d lvroot | |
args: | |
creates: /root | |
- name: create filesystem /tools | |
command: crfs -v jfs2 -A yes -m /tools -d lvtools | |
args: | |
creates: /tools | |
- name: change permissions on /root | |
file: path="/root" mode=0700 owner=root group=system | |
- name: mount /root | |
mount: name=/root src=/dev/lvroot state=mounted fstype=jfs2 | |
- name: mount /tools | |
mount: name=/tools src=/dev/lvtools state=mounted fstype=jfs2 | |
- name: change root home directory | |
user: name=root home=/root | |
- name: deploy authorized key | |
authorized_key: user=root key="{{ lookup('file', '/Users/adejoux/.ssh/id_rsa.pub') }}" | |
- name: deploy root profile | |
copy: src=root_profile dest=/root/.profile owner=root group=system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment