It is very strange. I do two cases:
Case 1:1. Use command "sysctl -w net.ipv4.icmp_echo_ignore_all=1" to disable ping
2. Use playbook sysctl module to enable ping, enabling ping would be failed.
Command sysctl -w net.ipv4.icmp_echo_ignore_all=1 doesn't change /etc/sysctl.conf file. In this case, sysctl module also doesn't change /etc/sysctl.conf.
Case 2:
1. Update /etc/sysctl.conf to set net.ipv4.icmp_echo_ignore_all=1
2. Execute sysctl -p to disable ping
3. Use playbook sysctl module to enable ping, enabling ping would be succesful.
In this case, sysctl module changes /etc/sysctl.conf.