2012-10-08 19:35:54 +00:00
|
|
|
---
|
2013-06-25 18:31:36 +00:00
|
|
|
|
|
|
|
- name: ntp pkgs
|
2015-05-13 23:34:00 +00:00
|
|
|
yum: state=present pkg={{ item }}
|
2013-06-25 18:31:36 +00:00
|
|
|
with_items:
|
|
|
|
- ntpdate
|
|
|
|
- ntp
|
2013-10-14 18:21:44 +02:00
|
|
|
- libsemanage-python
|
|
|
|
- libselinux-python
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int < 22
|
2012-12-05 06:19:23 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2015-05-13 23:34:00 +00:00
|
|
|
- name: ntp pkgs
|
|
|
|
command: dnf install -y ntpdate ntp libsemanage-python libselinux-python
|
2015-05-27 22:09:03 +00:00
|
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
2013-10-16 12:00:11 +02:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
2012-12-05 06:19:23 +00:00
|
|
|
- name: put step-tickers in place
|
2014-01-01 19:15:11 +00:00
|
|
|
action: copy src="{{ files }}/common/step-tickers" dest=/etc/ntp/step-tickers
|
2015-05-14 16:05:56 +02:00
|
|
|
when: ansible_cmdline.ostree is not defined
|
2015-09-07 15:53:13 +00:00
|
|
|
tags:
|
|
|
|
- ntp
|
|
|
|
- config
|
2012-12-05 06:19:23 +00:00
|
|
|
|
|
|
|
- name: enable the service
|
|
|
|
action: service name=ntpd state=running enabled=true
|
2015-05-14 16:08:56 +02:00
|
|
|
when: ansible_cmdline.ostree is not defined
|
2012-12-05 06:19:23 +00:00
|
|
|
|
2014-10-04 23:39:47 +00:00
|
|
|
#- name: edit hostname to be instance name - prefix hostbase var if it exists
|
|
|
|
# action: shell hostname {{ hostbase }}`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
|
|
|
# tags:
|
|
|
|
# - config
|
2012-11-02 06:22:19 +00:00
|
|
|
|
|
|
|
- name: add ansible root key
|
2013-06-17 13:54:17 +00:00
|
|
|
action: authorized_key user=root key="{{ item }}"
|
|
|
|
with_file:
|
2013-08-30 19:32:00 +00:00
|
|
|
- /srv/web/infra/ansible/roles/base/files/ansible-pub-key
|
2012-10-08 19:35:54 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2015-07-13 13:36:06 +00:00
|
|
|
- sshkeys
|
2012-11-02 06:22:19 +00:00
|
|
|
|
|
|
|
- name: add root keys for sysadmin-main and other allowed users
|
2014-03-28 15:07:34 +00:00
|
|
|
authorized_key: user=root key="{{ item }}"
|
2015-03-17 21:23:00 +00:00
|
|
|
with_lines: "/srv/web/infra/ansible/scripts/auth-keys-from-fas @sysadmin-main {{ root_auth_users }}"
|
2012-10-26 17:31:32 +00:00
|
|
|
tags:
|
|
|
|
- config
|
2015-07-13 13:36:06 +00:00
|
|
|
- sshkeys
|
2013-07-02 19:26:24 +00:00
|
|
|
ignore_errors: true
|
2012-11-02 06:22:19 +00:00
|
|
|
|
2013-10-04 07:36:31 +00:00
|
|
|
- name: enable ssh_sysadm_login sebool
|
|
|
|
action: seboolean name=ssh_sysadm_login state=yes persistent=yes
|
|
|
|
|
2012-10-19 20:17:20 +00:00
|
|
|
# note - kinda should be a handler - but handlers need args
|
|
|
|
- name: restorecon
|
|
|
|
action: command restorecon -R /root/.ssh
|
|
|
|
tags:
|
|
|
|
- config
|
|
|
|
|
2015-05-13 23:34:00 +00:00
|
|
|
- name: update all
|
|
|
|
command: yum -y update creates=/etc/sysconfig/global-update-applied
|
|
|
|
register: updated
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int < 22
|
2015-05-13 23:34:00 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
|
|
|
- name: update all
|
|
|
|
command: dnf -y update creates=/etc/sysconfig/global-update-applied
|
|
|
|
register: updated
|
2015-05-27 22:27:39 +00:00
|
|
|
when: ansible_distribution_major_version|int > 21 and ansible_cmdline.ostree is not defined
|
2015-05-13 23:34:00 +00:00
|
|
|
tags:
|
|
|
|
- packages
|
|
|
|
|
|
|
|
- name: write out global-update-applied file if we updated
|
|
|
|
copy: content="updated" dest=/etc/sysconfig/global-update-applied
|
|
|
|
when: updated is defined
|
|
|
|
tags:
|
|
|
|
- packages
|