2021-11-17 02:24:06 -05:00
|
|
|
- name: ipad setup
|
|
|
|
hosts: ipads
|
|
|
|
gather_facts: no
|
|
|
|
tasks:
|
2022-06-27 23:10:52 -04:00
|
|
|
- name: Set ssh to use password auth
|
|
|
|
set_fact:
|
|
|
|
ansible_ssh_pass: "{{ lookup('passwordstore', 'servers/cms/mobile@ipads') | d(omit) }}"
|
|
|
|
- name: Get ssh pub key
|
|
|
|
set_fact:
|
|
|
|
authorized_keys: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
|
|
|
- name: Write .ssh/authorized_keys
|
|
|
|
raw: mkdir -p ~/.ssh && echo "{{ authorized_keys }}" > ~/.ssh/authorized_keys
|
2021-11-17 02:24:06 -05:00
|
|
|
- name: Allow Pubkey Authentication for OpenSSH
|
2022-06-27 23:10:52 -04:00
|
|
|
become: true
|
2021-11-17 02:24:06 -05:00
|
|
|
raw: >-
|
|
|
|
sed -i /etc/ssh/sshd_config
|
|
|
|
-e 's|^#\?PubkeyAuthentication\W.*|PubkeyAuthentication yes|'
|
|
|
|
-e 's|^#\?AuthorizedKeysFile\W.*|AuthorizedKeysFile %h/.ssh/authorized_keys|'
|
|
|
|
-e 's|^#\?PermitRootLogin\W.*|PermitRootLogin no|'
|
|
|
|
- name: Fix /var/mobile permissions
|
|
|
|
raw: chmod 750 /var/mobile
|
|
|
|
- name: restart sshd
|
2022-06-27 23:10:52 -04:00
|
|
|
become: true
|
2022-06-27 23:09:39 -04:00
|
|
|
raw: launchctl stop system/com.openssh.sshd; launchctl start system/com.openssh.sshd
|
|
|
|
ignore_errors: yes
|
2021-11-17 02:24:06 -05:00
|
|
|
- name: copy python 2.7 deb
|
|
|
|
local_action: command scp -r ./python_2.7.6-3_iphoneos-arm.deb "{{ inventory_hostname }}:"
|
|
|
|
- name: install python 2.7
|
2022-06-27 23:10:52 -04:00
|
|
|
become: true
|
2022-06-27 23:10:16 -04:00
|
|
|
raw: dpkg -i python_2.7.6-3_iphoneos-arm.deb && rm python_2.7.6-3_iphoneos-arm.deb; apt-get install -f
|